| |
|
| java.lang.Object javax.rmi.PortableRemoteObject
PortableRemoteObject | public class PortableRemoteObject (Code) | | Server implementation objects may either inherit from
javax.rmi.PortableRemoteObject or they may implement a remote interface
and then use the exportObject method to register themselves as a server object.
The toStub method takes a server implementation and returns a stub that
can be used to access that server object.
The connect method makes a Remote object ready for remote communication.
The unexportObject method is used to deregister a server object, allowing it to become
available for garbage collection.
The narrow method takes an object reference or abstract interface type and
attempts to narrow it to conform to
the given interface. If the operation is successful the result will be an
object of the specified type, otherwise an exception will be thrown.
|
Constructor Summary | |
protected | PortableRemoteObject() Initializes the object by calling exportObject(this) . |
Method Summary | |
public static void | connect(Remote target, Remote source) Makes a Remote object ready for remote communication. | public static void | exportObject(Remote obj) Makes a server object ready to receive remote calls. | public static java.lang.Object | narrow(java.lang.Object narrowFrom, java.lang.Class narrowTo) Checks to ensure that an object of a remote or abstract interface type
can be cast to a desired type.
Parameters: narrowFrom - the object to check. Parameters: narrowTo - the desired type. | public static Remote | toStub(Remote obj) Returns a stub for the given server object.
Parameters: obj - the server object for which a stub is required. | public static void | unexportObject(Remote obj) Deregisters a server object from the runtime, allowing the object to become
available for garbage collection. |
PortableRemoteObject | protected PortableRemoteObject() throws RemoteException(Code) | | Initializes the object by calling exportObject(this) .
exception: RemoteException - if export fails. |
connect | public static void connect(Remote target, Remote source) throws RemoteException(Code) | | Makes a Remote object ready for remote communication. This normally
happens implicitly when the object is sent or received as an argument
on a remote method call, but in some circumstances it is useful to
perform this action by making an explicit call. See the
Stub.connect method for more information.
Parameters: target - the object to connect. Parameters: source - a previously connected object. throws: RemoteException - if source is not connectedor if target is already connected to a different ORB thansource . |
exportObject | public static void exportObject(Remote obj) throws RemoteException(Code) | | Makes a server object ready to receive remote calls. Note
that subclasses of PortableRemoteObject do not need to call this
method, as it is called by the constructor.
Parameters: obj - the server object to export. exception: RemoteException - if export fails. |
unexportObject | public static void unexportObject(Remote obj) throws NoSuchObjectException(Code) | | Deregisters a server object from the runtime, allowing the object to become
available for garbage collection.
Parameters: obj - the object to unexport. exception: NoSuchObjectException - if the remote object is notcurrently exported. |
|
|
|