stella.adapter
Class FieldSerializer

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.adapter.FieldSerializer
All Implemented Interfaces:
Cloneable, Remote, EventListener, RmiErrorListener, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiEventListener, RmiListener, RmiPropertyBearing

public class FieldSerializer
extends AbstractRmiListener
implements RmiErrorListener

A class that listens to the adapter master and serializes incoming status messages for off-line retrieval using GuiderInfos.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static String DEFCLASSLOOKUP
          The default class-lookup table.
private static String DEFEXTENSION
          The default field-of-view extension.
static String KEY_ADAPTERMASTER
          The key denoting a comma-separated list of error casters.
static String KEY_CLASSLOOKUP
          Look-up table transforming class type of error to extension.
static String KEY_EXTENSION
          The extension used for the field-of-view objects, including dot.
static String KEY_SAVECLASS
          This are the simple names of the classes to save.
static String KEY_SAVEPATH
          The directory where we serialize guider infos into.
private  Map<String,String> lookup
          Lookup-table for simple class names to file name parts.
private  List<String> save
          List of simple class names to consider.
 
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
FieldSerializer(Map<String,String> info)
          Constructs a new message logger.
 
Method Summary
protected  boolean deregisterAtCaster(RmiCaster rmi, Class single)
          Deregisters at caster.
 void init()
          Register at the appropriate casters found in the various lists.
static void main(String[] arg)
          Runs the status serializer.
protected  boolean registerAtCaster(RmiCaster rmi, Class single)
          Registers at the specified caster if the caster is one of the four possible caster instances this class listens to.
 void rmiErrorOccured(ErrorEvent ee)
          The receiving edge of the error listener.
private  boolean serialize(FieldOfView fov, File into)
          We serialize the list of stars into the file.
 
Methods inherited from class util.rmi.AbstractRmiListener
allBound, blockBinding, blockBinding, disconnect, exit, 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_ADAPTERMASTER

public static final String KEY_ADAPTERMASTER
The key denoting a comma-separated list of error casters.

See Also:
Constant Field Values

KEY_SAVECLASS

public static final String KEY_SAVECLASS
This are the simple names of the classes to save.

See Also:
Constant Field Values

KEY_SAVEPATH

public static final String KEY_SAVEPATH
The directory where we serialize guider infos into.

See Also:
Constant Field Values

KEY_EXTENSION

public static final String KEY_EXTENSION
The extension used for the field-of-view objects, including dot.

See Also:
Constant Field Values

KEY_CLASSLOOKUP

public static final String KEY_CLASSLOOKUP
Look-up table transforming class type of error to extension.

See Also:
Constant Field Values

DEFEXTENSION

private static final String DEFEXTENSION
The default field-of-view extension.

See Also:
Constant Field Values

DEFCLASSLOOKUP

private static final String DEFCLASSLOOKUP
The default class-lookup table.

See Also:
Constant Field Values

lookup

private Map<String,String> lookup
Lookup-table for simple class names to file name parts.


save

private List<String> save
List of simple class names to consider.

Constructor Detail

FieldSerializer

public FieldSerializer(Map<String,String> info)
                throws RemoteException
Constructs a new message logger. The properties handed over are also used for constructing the status panel.

Throws:
RemoteException
Method Detail

init

public void init()
Register at the appropriate casters found in the various lists.

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

rmiErrorOccured

public void rmiErrorOccured(ErrorEvent ee)
                     throws RemoteException
The receiving edge of the error listener. Looks for interesting status messages and fills the GuiderInfo with it.

Specified by:
rmiErrorOccured in interface RmiErrorListener
Throws:
RemoteException

registerAtCaster

protected boolean registerAtCaster(RmiCaster rmi,
                                   Class single)
Registers at the specified caster if the caster is one of the four possible caster instances this class listens to.

Specified by:
registerAtCaster in class AbstractRmiListener
Returns:
True, if this listener can register at the specified caster

deregisterAtCaster

protected boolean deregisterAtCaster(RmiCaster rmi,
                                     Class single)
Deregisters at caster. Simply checks if the caster handed over is of one of the four supported types and removes itself from its listener list. Note that this can also mean de-registering from casters we never registered to because this info is lost.

Specified by:
deregisterAtCaster in class AbstractRmiListener
Returns:
True, if this listener can deregister at the specified caster

serialize

private boolean serialize(FieldOfView fov,
                          File into)
We serialize the list of stars into the file.


main

public static void main(String[] arg)
Runs the status serializer. Incoming status messages are collected and serialized for off-line analysis.