org.objectweb.jeremie.libs.binding.soa
Class UnicastRemoteObject

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteStub
          extended byorg.objectweb.jeremie.libs.binding.soa.UnicastRemoteObject
All Implemented Interfaces:
java.rmi.Remote, java.io.Serializable

public class UnicastRemoteObject
extends java.rmi.server.RemoteStub

Provides an implementation of UnicastRemoteObject, multiple instances of which are managed together by an object adapter.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
protected UnicastRemoteObject()
          Creates a UnicastRemoteObject and exports it.
protected UnicastRemoteObject(int port)
          Creates a UnicastRemoteObject and exports it with the given port.
protected UnicastRemoteObject(int port, boolean daemon)
          Creates a UnicastRemoteObject and exports it with the given port.
 
Method Summary
static java.rmi.server.RemoteStub export(java.rmi.Remote impl, org.objectweb.jonathan.apis.kernel.Context hints, JRMIBFactory binder)
          Exports the given remote object to the object adapter, and then recursively to the given binding factory.
static java.rmi.server.RemoteStub exportObject(java.rmi.Remote impl)
          Exports the given remote object.
static java.rmi.server.RemoteStub exportObject(java.rmi.Remote impl, int port)
          Exports the given remote object with a given port.
static java.rmi.server.RemoteStub exportObject(java.rmi.Remote impl, int port, boolean daemon)
          Exports the given remote object with a given port.
 int hashCode()
           
static java.rmi.Remote toStub(java.rmi.Remote impl)
          Returns the Jeremie stub for the given remote object.
static boolean unexportObject(java.rmi.Remote impl, boolean force)
          Unexports the specified remote object.
static void unexportObject(java.rmi.Remote impl, JRMIBFactory binder)
          Unexports the given remote object from the object adapter and the given binding factory.
protected  java.lang.Object writeReplace()
          Returns the stub object corresponding to this UnicastRemoteObject.
 
Methods inherited from class java.rmi.server.RemoteStub
setRef
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnicastRemoteObject

protected UnicastRemoteObject()
                       throws java.rmi.RemoteException
Creates a UnicastRemoteObject and exports it.

Throws:
java.rmi.RemoteException - if something goes wrong.

UnicastRemoteObject

protected UnicastRemoteObject(int port)
                       throws java.rmi.RemoteException
Creates a UnicastRemoteObject and exports it with the given port.

Parameters:
port - the port number on which to export this UnicastRemoteObject.
Throws:
java.rmi.RemoteException - if something goes wrong.

UnicastRemoteObject

protected UnicastRemoteObject(int port,
                              boolean daemon)
                       throws java.rmi.RemoteException
Creates a UnicastRemoteObject and exports it with the given port.

Parameters:
port - the port number on which to export this UnicastRemoteObject.
daemon - indicates that only daemon threads should be created by the export process.
Throws:
java.rmi.RemoteException - if something goes wrong.
Method Detail

hashCode

public int hashCode()

writeReplace

protected java.lang.Object writeReplace()
                                 throws java.io.ObjectStreamException
Returns the stub object corresponding to this UnicastRemoteObject.

Throws:
java.io.ObjectStreamException - if something goes wrong.

exportObject

public static java.rmi.server.RemoteStub exportObject(java.rmi.Remote impl)
                                               throws java.rmi.RemoteException
Exports the given remote object.

Parameters:
impl - the remote object to export.
Returns:
a stub corresponding to the remote object.
Throws:
java.rmi.RemoteException - if something goes wrong.

exportObject

public static java.rmi.server.RemoteStub exportObject(java.rmi.Remote impl,
                                                      int port)
                                               throws java.rmi.RemoteException
Exports the given remote object with a given port.

Parameters:
impl - the remote object to export;
port - the port number with which to export the remote object.
Returns:
a stub corresponding to the remote object.
Throws:
java.rmi.RemoteException - if something goes wrong.

exportObject

public static java.rmi.server.RemoteStub exportObject(java.rmi.Remote impl,
                                                      int port,
                                                      boolean daemon)
                                               throws java.rmi.RemoteException
Exports the given remote object with a given port.

Parameters:
impl - the remote object to export;
port - the port number with which to export the remote object.
daemon - indicates that only daemon threads should be created by the export process.
Returns:
a stub corresponding to the remote object.
Throws:
java.rmi.RemoteException - if something goes wrong.

export

public static java.rmi.server.RemoteStub export(java.rmi.Remote impl,
                                                org.objectweb.jonathan.apis.kernel.Context hints,
                                                JRMIBFactory binder)
                                         throws java.rmi.RemoteException
Exports the given remote object to the object adapter, and then recursively to the given binding factory.

Parameters:
impl - the remote object to be exported;
hints - other data that may be useful for the export;
binder - a binding factory.
Returns:
a stub corresponding to the remote object.
Throws:
java.rmi - RemoteException if something goes wrong.
java.rmi.RemoteException

unexportObject

public static boolean unexportObject(java.rmi.Remote impl,
                                     boolean force)
Unexports the specified remote object. If the boolean parameter is true, the object is unexported even if there are pending calls or calls in progress. If the boolean parameter is false, the unexported only if there are no pending calls or calls in progress.

The force mechanism is not implemented yet.

Parameters:
force - whether the object should be forcibly unexported or not.
Returns:
whether the unexport operation succeeded or not.

unexportObject

public static void unexportObject(java.rmi.Remote impl,
                                  JRMIBFactory binder)
Unexports the given remote object from the object adapter and the given binding factory.

Parameters:
impl - the remote object to unexport;
binder - a binding factory.

toStub

public static java.rmi.Remote toStub(java.rmi.Remote impl)
                              throws java.rmi.NoSuchObjectException
Returns the Jeremie stub for the given remote object. The remote object must previously have been exported to Jeremie, otherwise an exception is raised.

Parameters:
impl - the remote object whose stub is required
Returns:
the Jeremie stub for the remote object
Throws:
java.rmi.NoSuchObjectException - if the remote object had not been previously exported to Jeremie.