org.objectweb.jeremie.libs.binding.moa
Class MOAContext

java.lang.Object
  extended byorg.objectweb.jeremie.libs.binding.moa.MOAContext
All Implemented Interfaces:
RMIContext

public class MOAContext
extends java.lang.Object
implements RMIContext

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


Constructor Summary
MOAContext(JRMIBFactory binder, org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
           
 
Method Summary
static java.rmi.server.RemoteStub export(java.rmi.Remote impl, org.objectweb.jonathan.apis.kernel.Context hints, JRMIBFactory binder, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
          Exports the given remote object to the object adapter, and then recursively to the given binding factory.
 java.rmi.server.RemoteStub export(java.rmi.Remote obj, int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
          Exports a remote object on the specified port.
static java.rmi.Remote toStub(java.rmi.Remote impl)
          Returns the Jeremie stub for the given remote object.
 boolean unexport(java.rmi.Remote obj, boolean force)
          Unexports the specified remote object.
static void unexport(java.rmi.Remote impl, JRMIBFactory binder)
          Unexports the given remote object from the object adapter and the given binding factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MOAContext

public MOAContext(JRMIBFactory binder,
                  org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
Method Detail

export

public java.rmi.server.RemoteStub export(java.rmi.Remote obj,
                                         int port,
                                         java.rmi.server.RMIClientSocketFactory csf,
                                         java.rmi.server.RMIServerSocketFactory ssf)
                                  throws java.rmi.RemoteException
Exports a remote object on the specified port. Incoming calls are accepted on the port via a server socket supplied by the specified server socket factory. Clients will make calls via sockets supplied by the specified client socket factory.

Specified by:
export in interface RMIContext
Parameters:
obj - the remote object to be exported;
port - the port on which to export the object;
csf - the client socket factory supplying sockets for client-side connections to the remote object;
ssf - the server socket factory supplying a server side socket.
Returns:
a stub for the exported remote object.
Throws:
java.rmi.RemoteException - if something goes wrong.

unexport

public boolean unexport(java.rmi.Remote obj,
                        boolean force)
                 throws java.rmi.NoSuchObjectException
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.

Specified by:
unexport in interface RMIContext
Parameters:
obj - the remote object to be unexported;
force - whether the object should be forcibly unexported or not.
Returns:
whether the unexport operation succeeded or not.
Throws:
java.rmi.NoSuchObjectException - 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,
                                                java.rmi.server.RMIClientSocketFactory csf,
                                                java.rmi.server.RMIServerSocketFactory ssf)
                                         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

unexport

public static void unexport(java.rmi.Remote impl,
                            JRMIBFactory binder)
                     throws java.rmi.NoSuchObjectException
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.
Throws:
java.rmi.NoSuchObjectException

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, 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.