org.objectweb.jeremie.binding.moa

Class UnicastRemoteObject

Known Direct Subclasses:
JRMIReferenceImpl

public class UnicastRemoteObject
extends RemoteStub

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

Constructor Summary

UnicastRemoteObject()
Creates a UnicastRemoteObject and exports it.
UnicastRemoteObject(int port)
Creates a UnicastRemoteObject and exports it with the given port.

Method Summary

static RemoteStub
export(Remote impl, Context hints, JRMIBFactory binder)
Exports the given remote object to the object adapter, and then recursively to the given binding factory.
static RemoteStub
exportObject(Remote impl)
Exports the given remote object.
static RemoteStub
exportObject(Remote impl, int port)
Exports the given remote object with a given port.
int
hashCode()
static Remote
toStub(Remote impl)
Returns the Jeremie stub for the given remote object.
static boolean
unexportObject(Remote impl, boolean force)
Unexports the specified remote object.
static void
unexportObject(Remote impl, JRMIBFactory binder)
Unexports the given remote object from the object adapter and the given binding factory.
protected Object
writeReplace()
Returns the stub object corresponding to this UnicastRemoteObject.

Constructor Details

UnicastRemoteObject

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


UnicastRemoteObject

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

Parameters:
port - the port number on which to export this UnicastRemoteObject.

Method Details

export

public static RemoteStub export(Remote impl,
                                Context hints,
                                JRMIBFactory binder)
            throws 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.


exportObject

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

Parameters:
impl - the remote object to export.

Returns:
a stub corresponding to the remote object.


exportObject

public static RemoteStub exportObject(Remote impl,
                                      int port)
            throws 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.


hashCode

public int hashCode()


toStub

public static Remote toStub(Remote impl)
            throws 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


unexportObject

public static boolean unexportObject(Remote impl,
                                     boolean force)
            throws 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.

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(Remote impl,
                                  JRMIBFactory binder)
            throws 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.


writeReplace

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