stella.net
Class TelescopeClient
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiCaster
stella.CastingContainer
stella.AbstractCommandLauncher
stella.net.CasterClient
stella.net.TelescopeClient
- All Implemented Interfaces:
- Cloneable, Remote, EventListener, Caster, CommandLaunching, ErrorCaster, ErrorListener, ReplyDeliverer, RmiAcknowledgeCaster, RmiCommandCaster, RmiDoneCaster, RmiErrorCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing
public class TelescopeClient
- extends CasterClient
- implements ErrorListener
This class acts as the command launching interface from the SCS side to the
telescope. It is based on a socket connection. This implies that all the
RMI-capabilities are plugged into this class, which leave the following
structure:
- It acts as an
ErrorCaster. The incoming ascii-errors from
the telescope are converted with an ErrorReceiver to local errors by
registering the telescope client as an ErrorListener. The SCS-error
handler, on the other side, will register at the telescope client.
- It acts also as an
RmiErrorCaster. This is meant for
remote loggers.
- This class also acts as an
RmiCommandCaster. The
command it sends to the telescope server are also simply sent as rmi event to
registered listeners. Again, this behaviour is intended for loggers.
- Any acknowledge or done event read in via the socket from the telescope
server is instantly also cast to via rmi to registerd loggers. In this sense,
the telescope client is also an
RmiAcknowledgeCaster and
an RmiDoneCaster.
| Methods inherited from class stella.net.CasterClient |
addRmiAcknowledgeListener, addRmiCommandListener, addRmiDoneListener, announceInterest, castCommand, checkForward, close, getAcknowledgeTimeOut, getAlarmGroup, getBufferSize, getClientName, getExitCommand, getPort, getReceiver, isReady, notifyAcknowledgeListener, notifyCommandListener, notifyDoneListener, recastCommand, registerReplySubscriber, removeRmiAcknowledgeListener, removeRmiCommandListener, removeRmiDoneListener |
| Methods inherited from class stella.CastingContainer |
addErrorListener, addRmiErrorListener, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatus |
| Methods inherited from class util.PropertyResources |
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from interface util.PropertySupplying |
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
KEY_ERRORSERVER
public static final String KEY_ERRORSERVER
- The key in the properties for the command server.
- See Also:
- Constant Field Values
asciierror
private ErrorReceiver asciierror
- A helper class to convert the incoming ascii-errors to event-casters.
TelescopeClient
public TelescopeClient(Map ensure)
throws RemoteException
- Constructs a telescope client. Exports it to the registry.
- Throws:
RemoteException
init
public void init()
- Uses the properties pointed to by
KEY_ERRORSERVER to construct
this class's helper application, the ErrorReceiver. The telescope
client registers itself to the error receiver as an error listener.
- Specified by:
init in interface Initializable- Overrides:
init in class CasterClient
- See Also:
CasterClient.KEY_RETRYCOUNT,
CasterClient.KEY_RETRYSLEEP
exit
public void exit()
- The shutdown-hook for the telescope. Additionally to closing the client
socket, also the error server socket is closed as soon as the client exit
method returns.
- Specified by:
exit in interface ExitCleaning- Overrides:
exit in class CasterClient
handles
public boolean handles(CommandEvent ce)
- A test caster handles test commands.
- Specified by:
handles in interface CommandLaunching- Overrides:
handles in class CasterClient
getShutdownCommand
public CommandEvent getShutdownCommand()
- The shutdown command of the telescope. Returns the
ParkTelescope
command.
- Specified by:
getShutdownCommand in interface CommandLaunching
errorOccured
public void errorOccured(ErrorEvent ee)
- The error events coming in from the ascii-error server. They are readily
cast to all registered error listeners of the telescope client. This
allows total separation of the ascii-part from the outer-world software,
relying on the only interface defined here in the telescope client.
- Specified by:
errorOccured in interface ErrorListener