|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiCaster
public abstract class AbstractRmiCaster
Base implementation of an rmi-enabled caster. This class provides method
bodies for all interfaces in the RmiCaster class, but is defined
abstract to insist on subclassing.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyContainer |
|---|
PropertyContainer.URLResource |
| Field Summary | |
|---|---|
private static Registry |
alternate
An alternate registry, if ALTERNATEHOST sys-property is set. |
static String |
ALTERNATEHOST
The system property of an alternate registry host. |
static String |
ALTERNATEPORT
The system property of an alternate registry host. |
private static int |
COUNT
An internal counter for automatic naming. |
private static int |
DEFEXPORTPORT
The port at which unicast should export. |
private static int |
DEFREGISTRYPORT
The port at which the registry accepts connections. |
private boolean |
isbound
True if this caster is bound to the registry. |
static String |
KEY_BINDNAME
The key in the Map referring to the bind name of the sensor. |
static String |
KEY_EXPORTPORT
For unicast exports, the port at which we should export. |
static String |
KEY_REGISTRYHOST
The key to the registry host or null for the local host. |
static String |
KEY_REGISTRYPORT
The key to the port the registry is accepting requests. |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES |
| Fields inherited from interface util.PropertyBearing |
|---|
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
protected |
AbstractRmiCaster(Map<String,String> prop)
Constructs a new rmi-caster. |
| Method Summary | |
|---|---|
static boolean |
bindAlternate(Remote rem,
String as)
Tries to bind to an alternate registry. |
private static boolean |
bindNow(Remote rem,
PropertyBearing info)
Binds a property container to the registry. |
boolean |
bindToRegistry()
Binds this class's casting capabilities to a running registry. |
static boolean |
bindToRegistry(PropertyBearing info)
Binds a property container to the registry. |
static boolean |
bindToRegistry(PropertyComposed info)
Binds a property container to the registry. |
void |
casterExit(List listeners)
Signals to this list of listeners that they should remove themself from getting events from this caster. |
static void |
casterExit(PropertyBearing caster,
List<?> listeners)
Signals to this list of listeners that they should remove themself from getting events from this caster. |
void |
exit()
On exit, we unbind from the registry. |
String |
getBindName()
Returns the binding name of this caster. |
static String |
getBindName(PropertyBearing info)
Returns the binding name of this caster. |
boolean |
isValid()
The method for listeners to check if the remote reference is still valid. |
private static int |
nextCount()
Gets the next available number at automatic naming. |
boolean |
unbindFromRegistry()
Unbinds this repository from the registry. |
static boolean |
unbindFromRegistry(PropertyBearing info)
Unbinds this repository from the registry. |
| Methods inherited from class util.rmi.RmiPropertyContainer |
|---|
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ALTERNATEHOST
public static final String ALTERNATEPORT
public static final String KEY_REGISTRYHOST
public static final String KEY_REGISTRYPORT
public static final String KEY_BINDNAME
public static final String KEY_EXPORTPORT
private static final int DEFREGISTRYPORT
private static final int DEFEXPORTPORT
private boolean isbound
private static int COUNT
private static Registry alternate
ALTERNATEHOST sys-property is set.
| Constructor Detail |
|---|
protected AbstractRmiCaster(Map<String,String> prop)
| Method Detail |
|---|
private static int nextCount()
public boolean isValid()
throws RemoteException
isValid in interface RmiCasterRemoteException
public boolean bindToRegistry()
throws RemoteException
bindToRegistry in interface RmiCasterRemoteException
public static boolean bindToRegistry(PropertyBearing info)
throws RemoteException
RemoteException
public static boolean bindToRegistry(PropertyComposed info)
throws RemoteException
RemoteException
private static boolean bindNow(Remote rem,
PropertyBearing info)
throws RemoteException
RemoteException
public static boolean bindAlternate(Remote rem,
String as)
ALTERNATEHOST and the ALTERNATEPORT
system properties are set and point to a host name/integer.java.rmi.server.hostname
is set to ALTERNATEHOST.ALTERNATEPORT.java.rmi.server.hostname is unset.
public void exit()
casterExit(java.util.List) method, then call the super method.
Non-subclasses of this class can use the static
unbindFromRegistry().
exit in interface ExitCleaningpublic void casterExit(List listeners)
public static void casterExit(PropertyBearing caster,
List<?> listeners)
public boolean unbindFromRegistry()
throws RemoteException
unbindFromRegistry in interface RmiCasterRemoteException
public static boolean unbindFromRegistry(PropertyBearing info)
throws RemoteException
RemoteExceptionpublic String getBindName()
KEY_BINDNAME is set it is used, otherwise we bind using
our class name and a running number and set this in the properties for
proper unbinding.
public static String getBindName(PropertyBearing info)
KEY_BINDNAME is set it is used, otherwise we bind using
our class name and a running number and set this in the properties for
proper unbinding. The static method can
be used with objects that do not want to extends the AbstractRmiCaster
directly.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||