org.objectweb.david.libs.binding.rmi
Class ORBPortableRemoteObjectDelegate
java.lang.Object
|
+--org.objectweb.david.libs.binding.rmi.ORBPortableRemoteObjectDelegate
- All Implemented Interfaces:
- DefaultStubTable, PortableRemoteObjectDelegate
- public class ORBPortableRemoteObjectDelegate
- extends Object
- implements PortableRemoteObjectDelegate, DefaultStubTable
This class provides an implementation for PortableRemoteObjectDelegate. It uses the connect and disconnect methods of ORB.
|
Method Summary |
void |
connect(Remote target,
Remote source)
This method makes the remote object target ready for remote communication
using the same communications runtime as source. |
void |
exportObject(Remote obj)
Exports the provided Remote implementation.
|
Object |
narrow(Object obj,
Class new_class)
This method takes an object reference or an object of an RMI/IDL abstract
interface type and attemps to narrow it to conform to the given newClass
RMI/IDL type. |
Remote |
toStub(Remote obj)
This method takes a server implementation object and returns a stub object
that can be used to access that server object. |
void |
unexportObject(Remote obj)
This method is used to deregister a currently exported server object from
the ORB runtimes, allowing the object to become available for garbage
collection. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ORBPortableRemoteObjectDelegate
public ORBPortableRemoteObjectDelegate()
- Constructs a new ORBPortableRemoteObjectDelegate instance.
exportObject
public void exportObject(Remote obj)
throws RemoteException
- Description copied from interface:
PortableRemoteObjectDelegate
- Exports the provided Remote implementation.
A call to this method with no objects exported creates a non-daemon thread
wich keeps the java virtual machine alive until all exported objects have
been unexported by calling unexportObject.
- Specified by:
exportObject in interface PortableRemoteObjectDelegate
- Following copied from interface:
javax.rmi.CORBA.PortableRemoteObjectDelegate
- Parameters:
obj - the object to export.- Throws:
RemoteException - if something goes wrong.
toStub
public Remote toStub(Remote obj)
throws NoSuchObjectException
- Description copied from interface:
PortableRemoteObjectDelegate
- This method takes a server implementation object and returns a stub object
that can be used to access that server object. The argument object must
currently be exported, either because it is a subclass of
PortableRemoteObject or by virtue of a previous call
exportObject.
- Specified by:
toStub in interface PortableRemoteObjectDelegate
- Following copied from interface:
javax.rmi.CORBA.PortableRemoteObjectDelegate
- Parameters:
obj - an exported Remote implementation;- Returns:
- a stub object to access it;
- Throws:
NoSuchObjectException - if the object is not currently exported.
unexportObject
public void unexportObject(Remote obj)
throws NoSuchObjectException
- Description copied from interface:
PortableRemoteObjectDelegate
- This method is used to deregister a currently exported server object from
the ORB runtimes, allowing the object to become available for garbage
collection.
- Specified by:
unexportObject in interface PortableRemoteObjectDelegate
- Following copied from interface:
javax.rmi.CORBA.PortableRemoteObjectDelegate
- Parameters:
obj - an exported Remote implementation;- Throws:
NoSuchObjectException - if the object is not currently exported.
narrow
public Object narrow(Object obj,
Class new_class)
throws ClassCastException
- Description copied from interface:
PortableRemoteObjectDelegate
- This method takes an object reference or an object of an RMI/IDL abstract
interface type and attemps to narrow it to conform to the given newClass
RMI/IDL type.
- Specified by:
narrow in interface PortableRemoteObjectDelegate
- Following copied from interface:
javax.rmi.CORBA.PortableRemoteObjectDelegate
- Parameters:
obj - the object to narrow;newClass - the expected type of the result;- Returns:
- an object of type newClass.
- Throws:
ClassCastException - if the operation fails.
connect
public void connect(Remote target,
Remote source)
throws RemoteException
- Description copied from interface:
PortableRemoteObjectDelegate
- This method makes the remote object target ready for remote communication
using the same communications runtime as source.
- Specified by:
connect in interface PortableRemoteObjectDelegate
- Following copied from interface:
javax.rmi.CORBA.PortableRemoteObjectDelegate
- Parameters:
target - a remote object;source - another remote object;- Throws:
RemoteException - if something goes wrong.