stella.util
Class TargetChangeListener

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by util.rmi.RmiPropertyContainer
                  extended by util.rmi.AbstractRmiListener
                      extended by stella.MessageListener
                          extended by stella.util.TargetChangeListener
All Implemented Interfaces:
Cloneable, Remote, EventListener, RmiAcknowledgeListener, RmiCommandListener, RmiDataListener, RmiDoneListener, RmiErrorListener, RmiSerialListener, RmiWeatherListener, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiEventListener, RmiListener, RmiPropertyBearing

public class TargetChangeListener
extends MessageListener

A class waiting for notification of target picks, then queries the target name and prints it to std-out.


Nested Class Summary
private static class TargetChangeListener.GridThread
          This thread updates the target log file and calls various other things.
static class TargetChangeListener.Run
          The standalone version reads the first command line argument and uses it as the error/status caster.
static class TargetChangeListener.Ssh
          Tests the sending of the ssh-command.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  Class action
          The error class we react on.
private static String DEFSSHCOMMAND
          Default ssh-script to execute.
private static String DEFSSHSCRIPT
          Default ssh-script to execute.
private static String DEFSSHUSER
          Default ssh-script to execute.
private static String DEFTARGETCLASS
          Default error to listen to.
static String KEY_SSHCOMMAND
          The key to the ssh-command .
static String KEY_SSHSCRIPT
          The key to the skript to execute.
static String KEY_SSHUSER
          The key to the ssh-user login, no password required.
static String KEY_TARGETCLASS
          The key to the status indicating the target change.
 
Fields inherited from class stella.MessageListener
KEY_ACKNOWLEDGE, KEY_BIND, KEY_BINDNAME, KEY_COMMAND, KEY_DATA, KEY_DONE, KEY_ERROR, KEY_SERIAL, KEY_WEATHER
 
Fields inherited from class util.rmi.AbstractRmiListener
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAY
 
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 util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
TargetChangeListener(Map prop)
          Constructs a new target change listener.
 
Method Summary
 void init()
          On init, we issue a binding request to the target name.
 void rmiErrorOccured(ErrorEvent ee)
          The receiving edge of the error listener.
 
Methods inherited from class stella.MessageListener
accepts, deregisterAtCaster, exit, registerAtCaster, rmiCommand, rmiDataAvailable, rmiGotAcknowledge, rmiGotDone, rmiSerial, rmiWeatherChanged
 
Methods inherited from class util.rmi.AbstractRmiListener
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBinding
 
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, 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 util.rmi.RmiEventListener
getListenerName
 
Methods inherited from interface util.rmi.RmiListener
disconnect, isConnected
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
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
 

Field Detail

KEY_TARGETCLASS

public static final String KEY_TARGETCLASS
The key to the status indicating the target change.

See Also:
Constant Field Values

KEY_SSHCOMMAND

public static final String KEY_SSHCOMMAND
The key to the ssh-command .

See Also:
Constant Field Values

KEY_SSHUSER

public static final String KEY_SSHUSER
The key to the ssh-user login, no password required.

See Also:
Constant Field Values

KEY_SSHSCRIPT

public static final String KEY_SSHSCRIPT
The key to the skript to execute.

See Also:
Constant Field Values

DEFTARGETCLASS

private static final String DEFTARGETCLASS
Default error to listen to.

See Also:
Constant Field Values

DEFSSHCOMMAND

private static final String DEFSSHCOMMAND
Default ssh-script to execute.

See Also:
Constant Field Values

DEFSSHUSER

private static final String DEFSSHUSER
Default ssh-script to execute.

See Also:
Constant Field Values

DEFSSHSCRIPT

private static final String DEFSSHSCRIPT
Default ssh-script to execute.

See Also:
Constant Field Values

action

private Class action
The error class we react on.

Constructor Detail

TargetChangeListener

public TargetChangeListener(Map prop)
                     throws RemoteException
Constructs a new target change listener. Init and binding is done later.

Throws:
RemoteException
Method Detail

init

public void init()
On init, we issue a binding request to the target name.

Specified by:
init in interface Initializable
Overrides:
init in class MessageListener

rmiErrorOccured

public void rmiErrorOccured(ErrorEvent ee)
                     throws RemoteException
The receiving edge of the error listener. Passes the error message received to Syslog.error, or, if the argument is a status message to Syslog.info.

Specified by:
rmiErrorOccured in interface RmiErrorListener
Overrides:
rmiErrorOccured in class MessageListener
Throws:
RemoteException