javax.rmi.CORBA
Interface PortableRemoteObjectDelegate

All Known Implementing Classes:
ORBPortableRemoteObjectDelegate

public interface PortableRemoteObjectDelegate

The implementation delegate class for javax.rmi.PortableRemoteObject must implement the following interface for per-class delegation.


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 newClass)
          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.
 

Method Detail

exportObject

public void exportObject(Remote obj)
                  throws RemoteException
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.
Parameters:
obj - the object to export.
Throws:
RemoteException - if something goes wrong.

toStub

public Remote toStub(Remote obj)
              throws NoSuchObjectException
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.
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
This method is used to deregister a currently exported server object from the ORB runtimes, allowing the object to become available for garbage collection.
Parameters:
obj - an exported Remote implementation;
Throws:
NoSuchObjectException - if the object is not currently exported.

narrow

public Object narrow(Object obj,
                     Class newClass)
              throws ClassCastException
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.
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
This method makes the remote object target ready for remote communication using the same communications runtime as source.
Parameters:
target - a remote object;
source - another remote object;
Throws:
RemoteException - if something goes wrong.