Used for exporting a remote object with JRMP and obtaining a stub
that communicates to the remote object.
Method from java.rmi.server.UnicastRemoteObject Detail: |
public Object clone() throws CloneNotSupportedException {
try {
UnicastRemoteObject cloned = (UnicastRemoteObject) super.clone();
cloned.reexport();
return cloned;
} catch (RemoteException e) {
throw new ServerCloneException("Clone failed", e);
}
}
Returns a clone of the remote object that is distinct from
the original. |
public static RemoteStub exportObject(Remote obj) throws RemoteException {
/*
* Use UnicastServerRef constructor passing the boolean value true
* to indicate that only a generated stub class should be used. A
* generated stub class must be used instead of a dynamic proxy
* because the return value of this method is RemoteStub which a
* dynamic proxy class cannot extend.
*/
return (RemoteStub) exportObject(obj, new UnicastServerRef(true));
}
Exports the remote object to make it available to receive incoming
calls using an anonymous port. |
public static Remote exportObject(Remote obj,
int port) throws RemoteException {
return exportObject(obj, new UnicastServerRef(port));
}
Exports the remote object to make it available to receive incoming
calls, using the particular supplied port. |
public static Remote exportObject(Remote obj,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf) throws RemoteException {
return exportObject(obj, new UnicastServerRef2(port, csf, ssf));
}
Exports the remote object to make it available to receive incoming
calls, using a transport specified by the given socket factory. |
public static boolean unexportObject(Remote obj,
boolean force) throws NoSuchObjectException {
return sun.rmi.transport.ObjectTable.unexportObject(obj, force);
}
Removes the remote object, obj, from the RMI runtime. If
successful, the object can no longer accept incoming RMI calls.
If the force parameter is true, the object is forcibly unexported
even if there are pending calls to the remote object or the
remote object still has calls in progress. If the force
parameter is false, the object is only unexported if there are
no pending or in progress calls to the object. |