|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
java.lang.Object | +--com.sas.net.rmi.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(Remote remoteObject,
int portNumber,
RMIClientSocketFactory rmiClientSocketFactory,
RMIServerSocketFactory rmiServerSocketFactory,
boolean isForcibleUnexport)
Constructs an instance specifying the server and client socket factories. |
|
| Method Summary | |
Remote |
exportObject()
Exports the remote object returning the remote object's stub. |
protected abstract Remote |
exportObject(Remote remoteObject,
int port,
RMIClientSocketFactory rmiClientSocketFactory,
RMIServerSocketFactory rmiServerSocketFactory)
Exports the remote object returning the remote object's stub. |
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. |
Remote |
getRemotableObject()
Gets the remote object that is to be exported to the RMI system. |
RMIClientSocketFactory |
getRMIClientSocketFactory()
Gets the RMI client socket factory. |
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(Remote remoteObject,
boolean isForcibleUnexport)
Unexports the remote object previously exported using the exportObject() method.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractRemoteObjectExporter(Remote remoteObject,
int portNumber,
RMIClientSocketFactory rmiClientSocketFactory,
RMIServerSocketFactory rmiServerSocketFactory,
boolean isForcibleUnexport)
throws 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.IllegalArgumentException - if an invalid remote object or port number
is specified.| Method Detail |
public final Remote exportObject()
throws 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 RemoteObjectExporterInterfaceRemoteException - if unable to unexport the remote object.
public final boolean unexportObject()
throws 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 RemoteObjectExporterInterfacetrue if the unexport operation was successfully completed.NoSuchObjectException - if unable to unexport the remote object.
protected abstract Remote exportObject(Remote remoteObject,
int port,
RMIClientSocketFactory rmiClientSocketFactory,
RMIServerSocketFactory rmiServerSocketFactory)
throws RemoteException
unexportObject() method.
This method is only intended to be called by this abstract
implementation's exportObject() method which will
provide the appropriate parameters.
null if no object
was exported.RemoteException - if unable to export the remote object.
protected abstract boolean unexportObject(Remote remoteObject,
boolean isForcibleUnexport)
throws 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.NoSuchObjectException - if unable to unexport the remote object.public final Remote getRemotableObject()
public final int getPortNumber()
Constants.PORT_ANONYMOUS designates an anonymous port.
public final boolean isExported()
isExported in interface RemoteObjectExporterInterfacetrue if the remote object is currently exported.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 Remote getExportedRemoteObjectStub()
exportObject() method.getExportedRemoteObjectStub in interface RemoteObjectExporterInterfacenull if an object is not currently exported.public final RMIClientSocketFactory getRMIClientSocketFactory()
null
is returned if a default factory is desired.public final RMIServerSocketFactory getRMIServerSocketFactory()
null
is returned if a default factory is desired.
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||