|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.net.rmi.AbstractRemoteObjectExporter
public abstract class AbstractRemoteObjectExporter
An abstract base class providing base implementations to export/unexport a remote object to/from the RMI system.
A concrete subclass must implement the following methods which are abstractly defined by this class:
The following subclasses provide concrete implementations of these abstract behaviors:
ActivatableExporter
to export an activatable objectUnicastRemoteObjectExporter
to export a unicast remote object. Some code examples are provided to illustrate
usage of the UnicastRemoteObjectExporter.
Note that remote object implementation classes which do not
extend UnicastRemoteObject
must assume the responsibility for the correct
semantics of the hashCode, equals, and toString methods inherited from the Object class, so that
they behave appropriately for remote objects.
ActivatableExporter
,
UnicastRemoteObjectExporter
Constructor Summary | |
---|---|
AbstractRemoteObjectExporter(java.rmi.Remote remoteObject,
int portNumber,
java.rmi.server.RMIClientSocketFactory rmiClientSocketFactory,
java.rmi.server.RMIServerSocketFactory rmiServerSocketFactory,
boolean isForcibleUnexport)
Constructs an instance specifying the server and client socket factories. |
Method Summary | |
---|---|
java.rmi.Remote |
exportObject()
Exports the remote object returning the remote object's stub. |
protected abstract java.rmi.Remote |
exportObject(java.rmi.Remote remoteObject,
int port,
java.rmi.server.RMIClientSocketFactory rmiClientSocketFactory,
java.rmi.server.RMIServerSocketFactory rmiServerSocketFactory)
Exports the remote object returning the remote object's stub. |
java.rmi.Remote |
getExportedRemoteObjectStub()
Gets the remote object that has been exported to the RMI system using the exportObject() method. |
int |
getPortNumber()
Gets the port number on which the remote object should be exported. |
java.rmi.Remote |
getRemotableObject()
Gets the remote object that is to be exported to the RMI system. |
java.rmi.server.RMIClientSocketFactory |
getRMIClientSocketFactory()
Gets the RMI client socket factory. |
java.rmi.server.RMIServerSocketFactory |
getRMIServerSocketFactory()
Gets the RMI server socket factory. |
boolean |
isExported()
Determines whether or not the remote object is currently exported. |
boolean |
isForcibleUnexport()
Determines whether or not the exported remote object should be forcibly unexported. |
void |
setIsForcibleUnexport(boolean isForcibleUnexport)
Determines whether or not the exported remote object should be forcibly unexported. |
boolean |
unexportObject()
Unexports the remote object from the RMI system. |
protected abstract boolean |
unexportObject(java.rmi.Remote remoteObject,
boolean isForcibleUnexport)
Unexports the remote object previously exported using the exportObject() method. |
Constructor Detail |
---|
public AbstractRemoteObjectExporter(java.rmi.Remote remoteObject, int portNumber, java.rmi.server.RMIClientSocketFactory rmiClientSocketFactory, java.rmi.server.RMIServerSocketFactory rmiServerSocketFactory, boolean isForcibleUnexport) throws java.lang.IllegalArgumentException
remoteObject
- The remote object that may be exported to the RMI system to create a
remote object stub. Ensure that the remote object implementation correctly
implements hashCode, equals, and toString methods to
ensure correct behavior by the remote object.portNumber
- Port on which the object should be exported. Specify
Constants.PORT_ANONYMOUS
to designate an anonymous port or a value greater
than 0
to designate a well-known port.rmiClientSocketFactory
- The client-side RMI socket factory is used to create sockets to
make calls to the remote object or null
if using the default.rmiServerSocketFactory
- The server-side RMI socket factory is used to create sockets to
receive remote calls or null
if using the default.isForcibleUnexport
- Specify true
if the remote object should be unexported
without regard to whether or not there are any active or pending remote calls or
false
if the remote object should not be unexported if there are
active or pending calls.
java.lang.IllegalArgumentException
- if an invalid remote object or port number is specified.Method Detail |
---|
public final java.rmi.Remote exportObject() throws java.rmi.RemoteException
This is a template method which calls
exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)
passing
the subclass implementation the object that is to be exported to the RMI system, the port,
and the RMI socket factories.
exportObject
in interface RemoteObjectExporterInterface
null
.
java.rmi.RemoteException
- if unable to unexport the remote object.RemoteObjectExporterInterface.unexportObject()
,
RemoteObjectExporterInterface.isExported()
,
RemoteObjectExporterInterface.getExportedRemoteObjectStub()
public final boolean unexportObject() throws java.rmi.NoSuchObjectException
This is a template method which calls
unexportObject(Remote exportedRemoteObject, boolean isForcibleUnexport)
passing the
subclass implementation the remote object that was originally passed to the
exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)
and
exported to the RMI system.
unexportObject
in interface RemoteObjectExporterInterface
true
if the unexport operation was successfully completed.
java.rmi.NoSuchObjectException
- if unable to unexport the remote object.RemoteObjectExporterInterface.exportObject()
,
RemoteObjectExporterInterface.isExported()
protected abstract java.rmi.Remote exportObject(java.rmi.Remote remoteObject, int port, java.rmi.server.RMIClientSocketFactory rmiClientSocketFactory, java.rmi.server.RMIServerSocketFactory rmiServerSocketFactory) throws java.rmi.RemoteException
unexportObject()
method.
This method is only intended to be called by this abstract implementation's
exportObject()
method which will provide the appropriate parameters.
remoteObject
- An object which implements a remote interface.port
- The port on which the service should be exported. Specify
0
if you want to use an anonymous port.rmiClientSocketFactory
- The RMI client socket factory or null
if the
default factory should be used.rmiServerSocketFactory
- The RMI server socket factory or null
if the
default factory should be used.
null
if no object was exported.
java.rmi.RemoteException
- if unable to export the remote object.protected abstract boolean unexportObject(java.rmi.Remote remoteObject, boolean isForcibleUnexport) throws java.rmi.NoSuchObjectException
exportObject()
method.
This method is only intended to be called by this abstract implementation's
unexportObject()
method which will provide the appropriate parameters.
remoteObject
- The remote object which was exported to the RMI system.isForcibleUnexport
- true
if the remote object's stub should be forcibly
removed from the RMI system without regard to whether or not there are any active
or pending calls. Specify false
if the stub should not be unexported
if there are active or pending calls.
true
if the unexport operation was successfully completed.
java.rmi.NoSuchObjectException
- if unable to unexport the remote object.public final java.rmi.Remote getRemotableObject()
null
if an object implementing a
remote interface has not been specified.public final int getPortNumber()
Constants.PORT_ANONYMOUS
designates an anonymous port.
public final boolean isExported()
isExported
in interface RemoteObjectExporterInterface
true
if the remote object is currently exported.RemoteObjectExporterInterface.exportObject()
,
RemoteObjectExporterInterface.unexportObject()
,
RemoteObjectExporterInterface.getExportedRemoteObjectStub()
public final boolean isForcibleUnexport()
true
if the exported remote object should be forcibly unexported.public final void setIsForcibleUnexport(boolean isForcibleUnexport)
isForcibleUnexport
- true
if the exported remote object should be forcibly
unexported. A forcible unexport will forcibly drop all active connections to the
remote object.public final java.rmi.Remote getExportedRemoteObjectStub()
exportObject()
method.
getExportedRemoteObjectStub
in interface RemoteObjectExporterInterface
null
if an
object is not currently exported.RemoteObjectExporterInterface.exportObject()
,
RemoteObjectExporterInterface.isExported()
public final java.rmi.server.RMIClientSocketFactory getRMIClientSocketFactory()
null
is returned if a default factory is
desired.public final java.rmi.server.RMIServerSocketFactory getRMIServerSocketFactory()
null
is returned if a default factory is
desired.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |