javax.rmi.CORBA
Interface PortableRemoteObjectDelegate


public interface PortableRemoteObjectDelegate

A delegate, implementing the functionality, provided by the PortableRemoteObject. The default delegate can be altered by setting the system property "javax.rmi.CORBA.PortableRemoteObjectClass" to the name of the alternative class that must implement PortableRemoteObjectDelegate.


Method Summary
 void connect(Remote target, Remote source)
           Makes the remote object target ready for remote communication using the same communications runtime as for the passed source parameter.
 void exportObject(Remote obj)
          Register the passed object with the ORB runtimes, making it remotely accessible.
 Object narrow(Object narrowFrom, Class narrowTo)
          Narrows the passed object to conform to the given interface or IDL type.
 Remote toStub(Remote obj)
          Takes a server implementation object and returns a stub object that can be used to access that server object (target).
 void unexportObject(Remote obj)
          Deregister a currently exported server object from the ORB runtimes.
 

Method Detail

connect

void connect(Remote target,
             Remote source)
             throws RemoteException

Makes the remote object target ready for remote communication using the same communications runtime as for the passed source parameter. Connection normally happens implicitly when the object is sent or received as an argument on a remote method call.

The target object is connected to the same ORB as source by calling the Stub.connect(org.omg.CORBA.ORB) if it is a stub or by associating its tie with an ORB if it is an implementation object.

Parameters:
target - the target object that may be either an RMI/IDL stub or an exported RMI/IDL implementation object
source - the source object may also be either an RMI/IDL stub or an exported RMI/IDL implementation object.
Throws:
RemoteException - if the target is already connected to another ORB.

exportObject

void exportObject(Remote obj)
                  throws RemoteException
Register the passed object with the ORB runtimes, making it remotely accessible. When called on jre with no objects exported, creates a non-daemon thread that prevents jre from terminating until all objects are unexported. Also, such object cannot be collected by garbage collector. This is usually impemented via Util.unexportObject(java.rmi.Remote)

Parameters:
object - the object to export.
Throws:
RemoteException

narrow

Object narrow(Object narrowFrom,
              Class narrowTo)
              throws ClassCastException
Narrows the passed object to conform to the given interface or IDL type. This method may return different instance and cannot be replaced by the direct cast.

Parameters:
narrowFrom - an object to narrow.
narrowTo - a type to that the object must be narrowed.
Returns:
On success, an object of type narrowTo or null, if narrowFrom = null.
Throws:
ClassCastException - if no narrowing is possible.

toStub

Remote toStub(Remote obj)
              throws NoSuchObjectException
Takes a server implementation object and returns a stub object that can be used to access that server object (target). If the target is connected, the returned stub is also connected to the same ORB. If the target is unconnected, the returned stub is unconnected.

Parameters:
target - a server side object.
Returns:
a stub object that can be used to access that server object.
Throws:
NoSuchObjectException - if a stub cannot be located for the given target.

unexportObject

void unexportObject(Remote obj)
                    throws NoSuchObjectException
Deregister a currently exported server object from the ORB runtimes. The object to becomes available for garbage collection. This is usually impemented via Util.unexportObject(java.rmi.Remote)

Parameters:
object - the object to unexport.
Throws:
NoSuchObjectException - if the passed object is not currently exported.