|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.healthmarketscience.rmiio.exporter.RemoteStreamExporter
public abstract class RemoteStreamExporter
Base class for objects which manage exporting RemoteStreamServers. "Exporting" is the act of making a RemoteStreamServer available remotely via some RPC framework (such as RMI). This class allows the rmiio utilities to be used with any RPC framework by separating the server implementation from the RPC integration.
See the getInstance()
method for details on how the default exporter
can be specified as a system property.
RemoteStreamExporter implementations are expected to be thread-safe and reentrant after construction.
For some helper classes which may be useful for alternative RPC
frameworks, see RemoteStreamServerInvokerHelper
,
RemoteInputStreamClientProxy
, and
RemoteOutputStreamClientProxy
.
Field Summary | |
---|---|
static String |
DEFAULT_EXPORTER_CLASS_NAME
name of the default exporter implementation returned by getInstance() if none is specified via system property |
static String |
EXPORTER_PROPERTY
system property used by getInstance() to determine which exporter
implementation to return |
protected static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
protected |
RemoteStreamExporter()
|
Method Summary | ||
---|---|---|
|
export(StreamServerType server)
Exports the given stream server via the desired RPC framework and returns the "remote" instance (often some sort of serializable stub object). |
|
protected abstract Object |
exportImpl(RemoteStreamServer<?,?> server)
Called by export(StreamServerType) to do the actual export work for the relevant
RPC framework. |
|
static RemoteStreamExporter |
getInstance()
Returns the default RemoteStreamExporter to use. |
|
void |
unexport(RemoteStreamServer<?,?> server)
Unexports the given previously exported stream server from the desired RPC framework. |
|
protected abstract void |
unexportImpl(RemoteStreamServer<?,?> server)
Called by unexport(com.healthmarketscience.rmiio.RemoteStreamServer, ?>) to do the actual unexport work for the
relevant RPC framework. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
public static final String EXPORTER_PROPERTY
getInstance()
to determine which exporter
implementation to return
public static final String DEFAULT_EXPORTER_CLASS_NAME
getInstance()
if none is specified via system property
Constructor Detail |
---|
protected RemoteStreamExporter()
Method Detail |
---|
public static RemoteStreamExporter getInstance()
EXPORTER_PROPERTY
or an instance of
DEFAULT_EXPORTER_CLASS_NAME
. The exporter is
instantiated once, on demand, and returned thereafter.public <StreamType,StreamServerType extends RemoteStreamServer<?,StreamType>> StreamType export(StreamServerType server) throws RemoteException
RemoteException
- if the stream instance could not be exportedpublic void unexport(RemoteStreamServer<?,?> server)
protected abstract Object exportImpl(RemoteStreamServer<?,?> server) throws RemoteException
export(StreamServerType)
to do the actual export work for the relevant
RPC framework. This method will be called synchronized on the given
stream instance, so it will not overlap an unexport(com.healthmarketscience.rmiio.RemoteStreamServer, ?>)
call for the
same instance.
Note, RemoteStreamServer implements Unreferenced, which is an rmi interface used to clean up servers which have lost their clients. RPC frameworks which export remote streams should attempt to handle abnormal client termination, and are encouraged to make use of the Unreferenced interface to shutdown an orphaned stream server.
RemoteException
- if the stream instance could not be exportedprotected abstract void unexportImpl(RemoteStreamServer<?,?> server) throws Exception
unexport(com.healthmarketscience.rmiio.RemoteStreamServer, ?>)
to do the actual unexport work for the
relevant RPC framework. This method will be called synchronized on the
given stream instance, so it will not overlap an export(StreamServerType)
call for
the same instance. This method call is allowed break existing
connections to this stream instance. Any exceptions thrown will be
logged, but otherwise ignored.
Exception
- if the unexport failed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |