stella.net
Class TelescopeClient

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by util.rmi.RmiPropertyContainer
                  extended by util.rmi.AbstractRmiCaster
                      extended by stella.CastingContainer
                          extended by stella.AbstractCommandLauncher
                              extended by stella.net.CasterClient
                                  extended by 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:


Nested Class Summary
private static class TelescopeClient.Blocking
          A class that allows blocking on incoming commands.
static class TelescopeClient.Test
          For simple testing of the telescope client functionality.
 
Nested classes/interfaces inherited from class stella.net.CasterClient
CasterClient.CommandSender
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  ErrorReceiver asciierror
          A helper class to convert the incoming ascii-errors to event-casters.
static String KEY_ERRORSERVER
          The key in the properties for the command server.
 
Fields inherited from class stella.net.CasterClient
KEY_ACKNOWLEDGETIMEOUT, KEY_ALARMGROUP, KEY_BIND, KEY_BUFFERSIZE, KEY_CASTERNAME, KEY_MAXWAITONCLOSE, KEY_PORT, KEY_RECEIVER, KEY_RETRYCOUNT, KEY_RETRYSLEEP
 
Fields inherited from class util.rmi.AbstractRmiCaster
ALTERNATEHOST, ALTERNATEPORT, KEY_BINDNAME, KEY_EXPORTPORT, KEY_REGISTRYHOST, KEY_REGISTRYPORT
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface stella.rmi.RmiCommandCaster
NAMING_EXTENSION
 
Fields inherited from interface stella.rmi.RmiAcknowledgeCaster
NAMING_EXTENSION
 
Fields inherited from interface stella.rmi.RmiDoneCaster
NAMING_EXTENSION
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
TelescopeClient(Map ensure)
          Constructs a telescope client.
 
Method Summary
 void errorOccured(ErrorEvent ee)
          The error events coming in from the ascii-error server.
 void exit()
          The shutdown-hook for the telescope.
 CommandEvent getShutdownCommand()
          The shutdown command of the telescope.
 boolean handles(CommandEvent ce)
          A test caster handles test commands.
 void init()
          Uses the properties pointed to by KEY_ERRORSERVER to construct this class's helper application, the ErrorReceiver.
 
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.AbstractCommandLauncher
createCommandLauncher
 
Methods inherited from class stella.CastingContainer
addErrorListener, addRmiErrorListener, isValid, notifyErrorListener, removeErrorListener, removeRmiErrorListener, sendError, sendError, sendError, sendStatus, sendStatus, sendStatus
 
Methods inherited from class util.rmi.AbstractRmiCaster
bindAlternate, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, getBindName, getBindName, unbindFromRegistry, unbindFromRegistry
 
Methods inherited from class util.rmi.RmiPropertyContainer
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
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 class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.rmi.RmiErrorCaster
addRmiErrorListener, removeRmiErrorListener
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 
Methods inherited from interface stella.ErrorCaster
addErrorListener, removeErrorListener
 
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
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

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.

Constructor Detail

TelescopeClient

public TelescopeClient(Map ensure)
                throws RemoteException
Constructs a telescope client. Exports it to the registry.

Throws:
RemoteException
Method Detail

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