javax.rmi.CORBA

Interface PortableRemoteObjectDelegate

public interface PortableRemoteObjectDelegate

A delegate, implementing the functionality, provided by the {@link 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 {@link PortableRemoteObjectDelegate}.
Method Summary
voidconnect(Remote target, Remote source)

Makes the remote object target ready for remote communication using the same communications runtime as for the passed source parameter.

voidexportObject(Remote obj)
Register the passed object with the ORB runtimes, making it remotely accessible.
Objectnarrow(Object narrowFrom, Class narrowTo)
Narrows the passed object to conform to the given interface or IDL type.
RemotetoStub(Remote obj)
Takes a server implementation object and returns a stub object that can be used to access that server object (target).
voidunexportObject(Remote obj)
Deregister a currently exported server object from the ORB runtimes.

Method Detail

connect

public 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. 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 {@link Stub#connect} 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

public void exportObject(Remote obj)
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 {@link Util#unexportObject}

Parameters: object the object to export.

Throws: RemoteException

narrow

public Object narrow(Object narrowFrom, Class narrowTo)
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

public Remote toStub(Remote obj)
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

public void unexportObject(Remote obj)
Deregister a currently exported server object from the ORB runtimes. The object to becomes available for garbage collection. This is usually impemented via {@link Util#unexportObject}

Parameters: object the object to unexport.

Throws: NoSuchObjectException if the passed object is not currently exported.