|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
fr.paris5.shaman.insight.component.AbstractExposedService
The base class for all exposed services, which MUST derive of it.
This class manages RMI export, but does not derive from
UnicastRemoteObject
in order to avoid RMI registration when using standalone.
How this is done :
JDK doc says that it's not mandatory to derive from
UnicastRemoteObject if the exported Object does provide
implementations of hashCode, equals,
and toString, which are compatible with remote object behavior.
Since this behavior relies on the knowledge of
remote reference
, some methods have been copied to provide
a consistent handling of this reference.
Note about support of Serializable interface :
A RMI server object must be serializable, but the intend is
not to serialize the whole server object, only its
remote reference
. Derived classes should not
take care of serialization.
Note about support of Avalon-Framework lifecycle-related
interface :
Those methods are declared final.
Fields inherited from interface fr.paris5.shaman.system.SystemConfigurationConstants |
BASEDIRURL_ATTRIBUTE, DEFAULTHOSTNAME, EMPTYSYSTEM_RESOURCE, HOSTNAME_ATTRIBUTE, PORT_ATTRIBUTE, RUNSTYLE_ATTRIBUTE, SYSTEMCONFIGURATION_DEFAULT_RESOURCE |
Fields inherited from interface fr.paris5.shaman.insight.component.InsightConfigurationConstants |
CLASS_ATTRIBUTE, COMMANDLOGS_ELEMENT, DEFAULT_PREVALENCEBASE_DIR, DIR_ELEMENT, EXPOSEDAS_ATTRIBUTE, LOGKITCONFIGURATION_DEFAULT_RESOURCE, PERSISTING_ATTRIBUTE, ROLE_ATTRIBUTE, SNAPSHOTDIR_ELEMENT, SYSTEMCONFIGURATIONURL_ATTRIBUTE |
Constructor Summary | |
|
AbstractExposedService()
Constructor for using service in an in-process context. |
|
AbstractExposedService(int port)
Constructor for exporting service as accessible remotely. |
protected |
AbstractExposedService(java.rmi.server.RemoteRef ref)
|
Method Summary | |
java.lang.Object |
clone()
Documentation copied from JDK 1.3.1_03 sources : Returns a clone of the remote object that is distinct from the original. |
void |
compose(org.apache.avalon.framework.component.ComponentManager componentManager)
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
contextualize(org.apache.avalon.framework.context.Context context)
|
void |
dispose()
|
protected void |
doCompose()
Subclasses may define their own behavior by overriding this method. |
protected void |
doConfigure(org.apache.avalon.framework.configuration.Configuration configuration)
Subclasses may define their own behavior by overriding this method. |
protected void |
doContextualize(InsightContext context)
Subclasses may define their own behavior by overriding this method. |
protected void |
doDispose()
Subclasses may define their own behavior by overriding this method. |
protected void |
doInitialize()
Subclasses may define their own behavior by overriding this method. |
boolean |
equals(java.lang.Object obj)
Documentation copied from JDK 1.3.1_03 sources : Compares two remote objects for equality. |
static java.rmi.Remote |
exportObject(java.rmi.Remote obj,
int port)
Documentation copied from JDK 1.3.1_03 sources : Export the remote object to make it available to receive incoming calls, using the particular supplied port. |
static java.rmi.Remote |
exportObject(java.rmi.Remote obj,
int port,
java.rmi.server.RMIClientSocketFactory csf,
java.rmi.server.RMIServerSocketFactory ssf)
Documentation copied from JDK 1.3.1_03 sources : Export the remote object to make it available to receive incoming calls, using a transport specified by the given socket factory. |
protected InsightManager |
getInsightManager()
|
protected org.apache.avalon.excalibur.logger.LogKitManager |
getLogManager()
|
java.rmi.server.RemoteRef |
getRef()
|
int |
hashCode()
Documentation copied from JDK 1.3.1_03 sources : Returns a hashcode for a remote object. |
void |
initialize()
|
void |
setLogKitManager(org.apache.avalon.excalibur.logger.LogKitManager logManager)
|
java.lang.String |
toString()
Documentation copied from JDK 1.3.1_03 sources : Returns a String that represents the value of this remote object. |
Constructor Detail |
public AbstractExposedService()
public AbstractExposedService(int port) throws java.rmi.RemoteException
port
- Use 0 if you don't know which port to use.protected AbstractExposedService(java.rmi.server.RemoteRef ref)
Method Detail |
protected void doContextualize(InsightContext context) throws org.apache.avalon.framework.context.ContextException
public final void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
protected void doCompose()
public final void compose(org.apache.avalon.framework.component.ComponentManager componentManager) throws org.apache.avalon.framework.component.ComponentException
protected final InsightManager getInsightManager()
protected void doConfigure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
public final void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
protected final void doInitialize() throws java.lang.Exception
public final void initialize() throws java.lang.Exception
protected void doDispose()
public final void dispose()
protected final org.apache.avalon.excalibur.logger.LogKitManager getLogManager()
public void setLogKitManager(org.apache.avalon.excalibur.logger.LogKitManager logManager)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- if clone failed due to
a RemoteException.public static java.rmi.Remote exportObject(java.rmi.Remote obj, int port) throws java.rmi.RemoteException
obj
- the remote object to be exportedport
- the port to export the object onjava.rmi.RemoteException
- if export failspublic static java.rmi.Remote exportObject(java.rmi.Remote obj, int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf) throws java.rmi.RemoteException
obj
- the remote object to be exportedport
- the port to export the object oncsf
- the client-side socket factory for making calls to the
remote objectssf
- the server-side socket factory for receiving remote callsjava.rmi.RemoteException
- if export failspublic java.rmi.server.RemoteRef getRef()
public int hashCode()
Hashtable
public boolean equals(java.lang.Object obj)
equals
method of its parameter with this remote object
as the argument.obj
- the Object to compare withHashtable
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |