stella.net
Class CasterClient

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
All Implemented Interfaces:
Cloneable, Remote, Caster, CommandLaunching, ErrorCaster, ReplyDeliverer, RmiAcknowledgeCaster, RmiCommandCaster, RmiDoneCaster, RmiErrorCaster, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster, RmiPropertyBearing
Direct Known Subclasses:
AdapterTelescopeCaster, TelescopeClient, TestCaster

public abstract class CasterClient
extends AbstractCommandLauncher
implements ReplyDeliverer, RmiCommandCaster, RmiAcknowledgeCaster, RmiDoneCaster, RmiErrorCaster, ErrorCaster, Initializable, ExitCleaning

The class to send commands as ascii strings via sockets. Note that the command server must be multithreaded though parallel processing of commands must be possible.
This class is used as a generic command event caster, only the receiver specified in the caster's properties may change.

This caster sends the specified command and receives the incoming acknowledge and done replies in a seperated thread. On sending a command a socket to the server is opened in the main thread, handed over to a handler sub-thread which is responsible for closing the socket after the final done event was received. Sending a command to the castCommand(stella.CommandEvent) immediately-returning method spawns this handler thread with the following capabilities:

To properly fullfil all of the specified requirements stated above a Caster must act in a variety of ways (i.e. implement interfaces), namly: Note that this class receives acknowledge and done events but is no listener to this event because everything is handled internally in String representations.

A ReplySubscriber can be associated with this caster instance. All incoming replies (i.e. acknowledge and done events are checked whether they should be forwarded to the reply subscriber. The intended use for this is that some sort of a command sequencer is not necessaryly interested in all acknowledge and done events sent back to the caster, but only in some that allow the sequencer optimal timing.

See Also:
ReplySubscriber

Nested Class Summary
protected  class CasterClient.CommandSender
          The helper thread for this ascii caster to handle a command/acknowledge/done sequence.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  List acknowledgeList
          The registered acknowledge listeners.
private  List activecommand
          A list of active command send threads.
private  ThreadGroup alarmGroup
          The ThreadGroup the alarms should run in.
private  int alarmNumber
          The numbering for the alarms.
private  Hashtable alarmTable
          The table mapping commands to alarms.
private static long ATISENLARGE
          Fuckin ATIS multiplier on time-outs.
private static int CAST
          An internal counter for automatic naming of the main command caster.
private static ThreadGroup commandGroup
          The thread group command senders run in.
private  List commandList
          The registered command listeners.
private  Socket connect
          The socket for this client.
private static long DEFACKNOWLEDGETIMEOUT
          The default acknowledge time-out value, in ms (10000).
private static ThreadGroup DEFALARMGROUP
          The default thread group the alarms run in.
private static boolean DEFBIND
          The default binding of the done caster (false).
private static int DEFBUFFERSIZE
          The default buffer size of the I/O streams (2048).
private static String DEFCASTERNAME
          The default name (Caster).
private static long DEFMAXWAITONCLOSE
          The default sleep intervall between server-up retries.
private static int DEFPORT
          The default port number (1026).
private static int DEFRETRYCOUNT
          The default number of retries if server is not ready.
private static long DEFRETRYSLEEP
          The default sleep intervall between server-up retries.
private  List doneList
          The registered done listeners.
private  ReplySubscriber forward
          The registered reply subscriber.
private static long ID
          A session ID.
private  BufferedReader in
          The input stream connected with the socket.
private  boolean isBound
          True if this caster is already bound.
private  boolean isclosing
          A boolean stating that the client is closing its connection.
static String KEY_ACKNOWLEDGETIMEOUT
          The key in the properties for the acknowledge time out.
static String KEY_ALARMGROUP
          The key in the properties for the alarm thread group.
static String KEY_BIND
          The key in the properties for binding the command caster.
static String KEY_BUFFERSIZE
          The key in the properties for the stream buffer size.
static String KEY_CASTERNAME
          The key in the properties defining the unique name of this caster.
static String KEY_MAXWAITONCLOSE
          The maximum wait on close operation.
static String KEY_PORT
          The key for the socket port.
static String KEY_RECEIVER
          The key in the properties for the command server.
static String KEY_RETRYCOUNT
          The key for the maximum retry number if server is down.
static String KEY_RETRYSLEEP
          The key for the maximum retry number if server is down.
private  CommandEvent lastCommand
          The last command sent.
private  Object lockread
          A locking object to prevent simultaneous read access to socket.
private  Object lockwrite
          A locking object to prevent simultaneous write access to socket.
private  BufferedWriter out
          The output stream connected with the socket.
private  List pattern
          The replies the reply subscriber is interested in.
private  Hashtable setOffAlarms
          The table mapping alarms that have been set off to commands.
 
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
protected CasterClient(Map qualify)
          Constructs a new caster with the specified properties.
 
Method Summary
 void addRmiAcknowledgeListener(RmiAcknowledgeListener ear)
          Registers an acknowledge event listener to this caster.
 void addRmiCommandListener(RmiCommandListener ear)
          Registers a command event listener to this caster.
 void addRmiDoneListener(RmiDoneListener ear)
          Registers a done event listener to this caster.
 void announceInterest(ReplyEvent re)
          Adds a new reply event pattern to the pattern list.
 void castCommand(CommandEvent ce)
          The public method called to cast a command to the specified receiver.
protected  void checkForward(ReplyEvent re)
          Checks if the received reply message should be forwarded to the registered reply subscriber.
protected  void close()
          Closes the socket and the associated streams.
 void exit()
          Performs an orderly exit for a threatening shutdown.
 long getAcknowledgeTimeOut()
          Returns the acknowledge time out, in ms.
 ThreadGroup getAlarmGroup()
          Returns the thread group the done and acknowledge time-out alarms should run in.
 int getBufferSize()
          Returns the buffer size used for buffering the socket streams.
 String getClientName()
          Returns the name used for this caster.
 CommandEvent getExitCommand()
          Default implementation of exit command is null.
 int getPort()
          Returns the port number the caster should connect to on the receiver.
 String getReceiver()
          Returns the name of the receiver of commands from this caster.
 boolean handles(CommandEvent ce)
          A caster client can only handle CloseSocket commands, as this command should be understood by any caster client dealing with sockets.
 void init()
          Initializes this caster's acknowledge and done casting binidings.
 boolean isReady()
          Should always return true if socket connection is open.
private  int nextAlarmNumber()
          Returns the next available number for the alarm numbering.
private static int nextCast()
          Gets the next available number at automatic naming of the caster.
private static long nextID()
          Returns the next session ID.
protected  void notifyAcknowledgeListener(AcknowledgeEvent ae)
          Notifies all registered RmiAcknowledgeListeners.
protected  void notifyCommandListener(CommandEvent ce)
          Notifies all registered RmiCommandListeners.
protected  void notifyDoneListener(DoneEvent de)
          Notifies all registered RmiDoneListeners.
private  void openSocket()
          Actually opens the socket and the associated streams.
 void recastCommand()
          Recasts the last command.
 void registerReplySubscriber(ReplySubscriber fwd)
          Registers the reply subscriber.
 void removeRmiAcknowledgeListener(RmiAcknowledgeListener ear)
          Deregisters an acknowledge event listener from this caster.
 void removeRmiCommandListener(RmiCommandListener ear)
          Deregisters a command event listener from this caster.
 void removeRmiDoneListener(RmiDoneListener ear)
          Deregisters a done event listener to this caster.
 
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 stella.CommandLaunching
getShutdownCommand
 
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_CASTERNAME

public static final String KEY_CASTERNAME
The key in the properties defining the unique name of this caster.

See Also:
Constant Field Values

KEY_RECEIVER

public static final String KEY_RECEIVER
The key in the properties for the command server.

See Also:
Constant Field Values

KEY_PORT

public static final String KEY_PORT
The key for the socket port.

See Also:
Constant Field Values

KEY_BIND

public static final String KEY_BIND
The key in the properties for binding the command caster.

See Also:
Constant Field Values

KEY_ACKNOWLEDGETIMEOUT

public static final String KEY_ACKNOWLEDGETIMEOUT
The key in the properties for the acknowledge time out.

See Also:
Constant Field Values

KEY_RETRYCOUNT

public static final String KEY_RETRYCOUNT
The key for the maximum retry number if server is down.

See Also:
Constant Field Values

KEY_RETRYSLEEP

public static final String KEY_RETRYSLEEP
The key for the maximum retry number if server is down.

See Also:
Constant Field Values

KEY_BUFFERSIZE

public static final String KEY_BUFFERSIZE
The key in the properties for the stream buffer size.

See Also:
Constant Field Values

KEY_ALARMGROUP

public static final String KEY_ALARMGROUP
The key in the properties for the alarm thread group.

See Also:
Constant Field Values

KEY_MAXWAITONCLOSE

public static final String KEY_MAXWAITONCLOSE
The maximum wait on close operation.

See Also:
Constant Field Values

DEFCASTERNAME

private static final String DEFCASTERNAME
The default name (Caster).

See Also:
Constant Field Values

DEFPORT

private static final int DEFPORT
The default port number (1026).

See Also:
Constant Field Values

DEFBIND

private static final boolean DEFBIND
The default binding of the done caster (false).

See Also:
Constant Field Values

DEFACKNOWLEDGETIMEOUT

private static final long DEFACKNOWLEDGETIMEOUT
The default acknowledge time-out value, in ms (10000).

See Also:
Constant Field Values

DEFBUFFERSIZE

private static final int DEFBUFFERSIZE
The default buffer size of the I/O streams (2048).

See Also:
Constant Field Values

DEFRETRYCOUNT

private static final int DEFRETRYCOUNT
The default number of retries if server is not ready.

See Also:
Constant Field Values

DEFRETRYSLEEP

private static final long DEFRETRYSLEEP
The default sleep intervall between server-up retries.

See Also:
Constant Field Values

DEFMAXWAITONCLOSE

private static final long DEFMAXWAITONCLOSE
The default sleep intervall between server-up retries.

See Also:
Constant Field Values

DEFALARMGROUP

private static final ThreadGroup DEFALARMGROUP
The default thread group the alarms run in.


ATISENLARGE

private static final long ATISENLARGE
Fuckin ATIS multiplier on time-outs.

See Also:
Constant Field Values

isBound

private boolean isBound
True if this caster is already bound.


commandList

private List commandList
The registered command listeners.


acknowledgeList

private List acknowledgeList
The registered acknowledge listeners.


doneList

private List doneList
The registered done listeners.


forward

private ReplySubscriber forward
The registered reply subscriber.


pattern

private List pattern
The replies the reply subscriber is interested in.


connect

private Socket connect
The socket for this client. Opened once, used many times.


out

private BufferedWriter out
The output stream connected with the socket.


in

private BufferedReader in
The input stream connected with the socket.


lockread

private Object lockread
A locking object to prevent simultaneous read access to socket.


lockwrite

private Object lockwrite
A locking object to prevent simultaneous write access to socket.


lastCommand

private CommandEvent lastCommand
The last command sent.


activecommand

private List activecommand
A list of active command send threads.


alarmGroup

private ThreadGroup alarmGroup
The ThreadGroup the alarms should run in.


alarmTable

private Hashtable alarmTable
The table mapping commands to alarms.


setOffAlarms

private Hashtable setOffAlarms
The table mapping alarms that have been set off to commands.


alarmNumber

private int alarmNumber
The numbering for the alarms. Allows distinct names.


isclosing

private boolean isclosing
A boolean stating that the client is closing its connection.


CAST

private static int CAST
An internal counter for automatic naming of the main command caster.


ID

private static long ID
A session ID.


commandGroup

private static final ThreadGroup commandGroup
The thread group command senders run in.

Constructor Detail

CasterClient

protected CasterClient(Map qualify)
Constructs a new caster with the specified properties. Use of this constructor guarantees that the caster name KEY_CASTERNAME, the connection socket port KEY_PORT, the bind properties as an rmi caster KEY_BIND, the acknowledge time-out (see KEY_ACKNOWLEDGETIMEOUT), the thread group the alarms should run in KEY_ALARMGROUP and the stream buffer size KEY_BUFFERSIZE is always set. Additionally the receiver is set to none if not present in the properties. Note that the default receiver does not map to an allowed receiver!

Parameters:
qualify - The properties of this caster
Method Detail

nextCast

private static int nextCast()
Gets the next available number at automatic naming of the caster.


nextID

private static long nextID()
Returns the next session ID.


nextAlarmNumber

private int nextAlarmNumber()
Returns the next available number for the alarm numbering.


init

public void init()
Initializes this caster's acknowledge and done casting binidings. If the default behaviour of this caster is to bind either of his RMI-casting capabilities to the registry, this is done here right after the construction phase. Note that registering of this Caster is always possible later using the AbstractRmiCaster.bindToRegistry() method regardless of the value of the binding key KEY_BIND.
Additionally, the socket to the server is opened. If the server is not ready, a delay loop is implemented to wait for the server to get up.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources
See Also:
KEY_RETRYCOUNT, KEY_RETRYSLEEP

getExitCommand

public CommandEvent getExitCommand()
Default implementation of exit command is null.

Specified by:
getExitCommand in interface CommandLaunching

openSocket

private void openSocket()
Actually opens the socket and the associated streams. If the server is not ready, a delay loop is implemented to wait for the server to get up.

See Also:
KEY_RETRYCOUNT, KEY_RETRYSLEEP

getClientName

public String getClientName()
Returns the name used for this caster. The name should be unique in the sense that it should unique match a name as to the Naming contract.

Specified by:
getClientName in interface CommandLaunching

getReceiver

public String getReceiver()
Returns the name of the receiver of commands from this caster. The name must fulfill the Naming contract, i.e. it must be a qualified IP number.


getPort

public int getPort()
Returns the port number the caster should connect to on the receiver.


getAcknowledgeTimeOut

public long getAcknowledgeTimeOut()
Returns the acknowledge time out, in ms. Use of the standard constructor guarantees that this property is set.


getBufferSize

public int getBufferSize()
Returns the buffer size used for buffering the socket streams.


getAlarmGroup

public ThreadGroup getAlarmGroup()
Returns the thread group the done and acknowledge time-out alarms should run in.


registerReplySubscriber

public void registerReplySubscriber(ReplySubscriber fwd)
Registers the reply subscriber. All received reply messages are checked whether they should be forwarded to the subscriber. Call this method with a null argument to disable reply forwarding.

Specified by:
registerReplySubscriber in interface ReplyDeliverer
Parameters:
forward - The reply subscriber interested in received replies.

isReady

public boolean isReady()
Should always return true if socket connection is open.

Specified by:
isReady in interface CommandLaunching

checkForward

protected void checkForward(ReplyEvent re)
Checks if the received reply message should be forwarded to the registered reply subscriber. This method scans through all stored reply event patterns and tries to find a match to the argument reply event. Due to the convention of the match method, see ReplyEvent.matches(stella.ReplyEvent) all stored reply patterns are used as arguments to the reply event under question.

If the argument is matched to one of the patterns the argument is immediately passed to the registered reply subscriber and the pattern is removed from the list.

Note that this method synchronizes on the pattern vector.


announceInterest

public void announceInterest(ReplyEvent re)
Adds a new reply event pattern to the pattern list. This method should be called by the reply subscriber prior to sending the command that will produce the appropriate reply to the caster (castCommand(stella.CommandEvent)). Otherwise timing fluctuation may cause problems.

Specified by:
announceInterest in interface ReplyDeliverer

addRmiCommandListener

public void addRmiCommandListener(RmiCommandListener ear)
                           throws RemoteException
Registers a command event listener to this caster.

Specified by:
addRmiCommandListener in interface RmiCommandCaster
Parameters:
ear - The command listener to register.
Throws:
RemoteException

removeRmiCommandListener

public void removeRmiCommandListener(RmiCommandListener ear)
                              throws RemoteException
Deregisters a command event listener from this caster.

Specified by:
removeRmiCommandListener in interface RmiCommandCaster
Parameters:
ear - The command listener to deregister.
Throws:
RemoteException

notifyCommandListener

protected void notifyCommandListener(CommandEvent ce)
Notifies all registered RmiCommandListeners. This method parses through the Vector of CommandListeners and passes the argument to their RmiCommandListener.rmiCommand(stella.CommandEvent) method. Registered listeners are RMI based.

Parameters:
ce - The CommandEvent to pass to the listeners.

addRmiAcknowledgeListener

public void addRmiAcknowledgeListener(RmiAcknowledgeListener ear)
                               throws RemoteException
Registers an acknowledge event listener to this caster. This acts as a work-around to provide acknowledge-casting capabilities to simple ascii-string based communication. The acknowledge-casting capabilities are shifted from the command-receiver to the command caster, meaning that incomming ascii-acknowledges are in-situ tranformed into acknowledge events and sent to registered listeners right after the acknowledge alarm has been canceled.

Specified by:
addRmiAcknowledgeListener in interface RmiAcknowledgeCaster
Parameters:
ear - The acknowledge listener to register.
Throws:
RemoteException

removeRmiAcknowledgeListener

public void removeRmiAcknowledgeListener(RmiAcknowledgeListener ear)
                                  throws RemoteException
Deregisters an acknowledge event listener from this caster. This acts as a work-around to provide acknowledge-casting capabilities to simple ascii-string based communication. The acknowledge-casting capabilities are shifted from the command-receiver to the command caster, meaning that incomming ascii-acknowledges are in-situ tranformed into acknowledge events and sent to registered listeners right after the acknowledge alarm has been canceled.

Specified by:
removeRmiAcknowledgeListener in interface RmiAcknowledgeCaster
Parameters:
ear - The acknowledge listener to deregister.
Throws:
RemoteException

notifyAcknowledgeListener

protected void notifyAcknowledgeListener(AcknowledgeEvent ae)
Notifies all registered RmiAcknowledgeListeners. This method parses through the Vector of AcknowledgeListeners and passes the argument to their RmiAcknowledgeListener.rmiGotAcknowledge(stella.AcknowledgeEvent) method. Registered listeners are RMI based.

Parameters:
ae - The AcknowledgeEvent to pass to the Listeners.

addRmiDoneListener

public void addRmiDoneListener(RmiDoneListener ear)
                        throws RemoteException
Registers a done event listener to this caster. This acts as a work-around to provide done-casting capabilities to simple ascii-string based communication. The done-casting capabilities are shifted from the command receiver to the command caster, meaning that incomming ascii-dones are in-situ tranformed into done events and sent to registered listeners right after the done alarm has been canceled.

Specified by:
addRmiDoneListener in interface RmiDoneCaster
Parameters:
ear - The done listener to register.
Throws:
RemoteException

removeRmiDoneListener

public void removeRmiDoneListener(RmiDoneListener ear)
                           throws RemoteException
Deregisters a done event listener to this caster. This acts as a work-around to provide done-casting capabilities to simple ascii-string based communication. The done-casting capabilities are shifted from the command receiver to the command caster, meaning that incomming ascii-dones are in-situ tranformed into done events and sent to registered listeners right after the done alarm has been canceled.

Specified by:
removeRmiDoneListener in interface RmiDoneCaster
Parameters:
ear - The done listener to deregister.
Throws:
RemoteException

notifyDoneListener

protected void notifyDoneListener(DoneEvent de)
Notifies all registered RmiDoneListeners. This method parses through the Vector of DoneListeners and passes the argument to their RmiDoneListener.rmiGotDone(stella.DoneEvent) method. Registered listeners are RMI based.

Parameters:
de - The DoneEvent to pass to the listeners.

handles

public boolean handles(CommandEvent ce)
A caster client can only handle CloseSocket commands, as this command should be understood by any caster client dealing with sockets. Note that subclasses should override this method.

Specified by:
handles in interface CommandLaunching

castCommand

public void castCommand(CommandEvent ce)
The public method called to cast a command to the specified receiver. If the receiver found in the properties is the default one (which indicates a non-valid receiver) this method throws a IllegalStateException. If the receiver is a valid IP-address this method does: The main work is done by the helper thread, see CasterClient.CommandSender.

If this method is called while an other command handler is still running the new command is simply cast to the listener. Please note that the command server must be capable of handling multiple connections simultaniously. Additionally, any command cast to the server must be terminated with a done sent back to this caster (i.e. the helper thread) otherwise lockup will occur!

Specified by:
castCommand in interface CommandLaunching

recastCommand

public void recastCommand()
Recasts the last command. The last command is kept in a private copy. The only problem is to get rid of unnecessary acknowledge time outs.

Because recasting of a command is only useful if the command has not been completely received at the receiver, only a first acknowledge may be in the waiting queue.

Specified by:
recastCommand in interface CommandLaunching

exit

public void exit()
Performs an orderly exit for a threatening shutdown. Simply cancels all running command senders and closes the sockets.
Note that this method violates the fast-return requirement of the ExitCleaning recommondation.

Specified by:
exit in interface ExitCleaning
Overrides:
exit in class CastingContainer

close

protected void close()
Closes the socket and the associated streams.