Home » openjdk-7 » java » rmi » server » [javadoc | source]
java.rmi.server
public class: UnicastRemoteObject [javadoc | source]
java.lang.Object
   java.rmi.server.RemoteObject
      java.rmi.server.RemoteServer
         java.rmi.server.UnicastRemoteObject

All Implemented Interfaces:
    Remote, Serializable

Used for exporting a remote object with JRMP and obtaining a stub that communicates to the remote object.

For the constructors and static exportObject methods below, the stub for a remote object being exported is obtained as follows:

Fields inherited from java.rmi.server.RemoteObject:
ref
Constructor:
 protected UnicastRemoteObject() throws RemoteException 
    Creates and exports a new UnicastRemoteObject object using an anonymous port.
    Throws:
    RemoteException - if failed to export object
    since: JDK1.1 -
 protected UnicastRemoteObject(int port) throws RemoteException 
    Creates and exports a new UnicastRemoteObject object using the particular supplied port.
    Parameters:
    port - the port number on which the remote object receives calls (if port is zero, an anonymous port is chosen)
    Throws:
    RemoteException - if failed to export object
    since: 1.2 -
 protected UnicastRemoteObject(int port,
    RMIClientSocketFactory csf,
    RMIServerSocketFactory ssf) throws RemoteException 
    Creates and exports a new UnicastRemoteObject object using the particular supplied port and socket factories.
    Parameters:
    port - the port number on which the remote object receives calls (if port is zero, an anonymous port is chosen)
    csf - the client-side socket factory for making calls to the remote object
    ssf - the server-side socket factory for receiving remote calls
    Throws:
    RemoteException - if failed to export object
    since: 1.2 -
Method from java.rmi.server.UnicastRemoteObject Summary:
clone,   exportObject,   exportObject,   exportObject,   unexportObject
Methods from java.rmi.server.RemoteServer:
getClientHost,   getLog,   setLog
Methods from java.rmi.server.RemoteObject:
equals,   getRef,   hashCode,   toString,   toStub
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.rmi.server.UnicastRemoteObject Detail:
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the remote object that is distinct from the original.
 public static RemoteStub exportObject(Remote obj) throws RemoteException 
    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 
    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 
    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 
    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.