stella.rmi
Class ErrorRelay
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
stella.rmi.ErrorRelay
- All Implemented Interfaces:
- Cloneable, Remote, EventListener, Caster, ErrorCaster, RmiErrorListener, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiEventListener, RmiListener, RmiPropertyBearing
public class ErrorRelay
- extends AbstractRmiListener
- implements RmiErrorListener, ErrorCaster
An rmi-error listener that acts as a local error caster.
|
Field Summary |
private boolean |
bound
Ture, if successfully registered to at least one listener. |
private List<ErrorListener> |
errlist
These are the local error listeners. |
static String |
KEY_RMIERROR
The key denoting a comma-separated list of rmi-error casters. |
|
Constructor Summary |
ErrorRelay(Map<String,String> prop)
We create a new error relay and start binding to the error casters in
the init section. |
| 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.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 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_RMIERROR
public static final String KEY_RMIERROR
- The key denoting a comma-separated list of rmi-error casters.
- See Also:
- Constant Field Values
errlist
private List<ErrorListener> errlist
- These are the local error listeners.
bound
private boolean bound
- Ture, if successfully registered to at least one listener.
ErrorRelay
public ErrorRelay(Map<String,String> prop)
throws RemoteException
- We create a new error relay and start binding to the error casters in
the init section.
- Throws:
RemoteException
init
public void init()
- We create a new list of local error listeners and start registering
at the remote error casters.
- Specified by:
init in interface Initializable- Overrides:
init in class PropertyResources
isBound
public boolean isBound()
- Return true, if we are bound to at least one error caster.
addErrorListener
public void addErrorListener(ErrorListener ear)
- Registers an error event listener to this property container. This
method is used for local listeners.
- Specified by:
addErrorListener in interface ErrorCaster
removeErrorListener
public void removeErrorListener(ErrorListener ear)
- Deregisters an error event listener from this property container.
This method is used for local listeners.
- Specified by:
removeErrorListener in interface ErrorCaster
rmiErrorOccured
public void rmiErrorOccured(ErrorEvent ee)
throws RemoteException
- We pass the error received to our listeners.
- Specified by:
rmiErrorOccured in interface RmiErrorListener
- Throws:
RemoteException
registerAtCaster
protected boolean registerAtCaster(RmiCaster rmi,
Class service)
- 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 service)
- 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
register
private void register(String list,
Class casterclass)
- Registers at a caster list.