Oracle

weblogic.rmi.extensions
Class PortableRemoteObject

java.lang.Object
  extended by weblogic.rmi.extensions.PortableRemoteObject

public final class PortableRemoteObject
extends Object

API for managing references required by higher-level functionality. In particular we need to be able to narrow to IDL interfaces and create initial references. These functions mirror those in PortableRemoteObject but guarantee that the WebLogic versions will be called since users can replace the implementation of PortableRemoteObject themselves.


Constructor Summary
PortableRemoteObject()
           
 
Method Summary
static void exportObject(Remote obj)
          Makes a server object ready to receive remote calls.
static Object narrow(Object narrowFrom, Class narrowTo)
          Checks to ensure that an object of a remote or abstract interface type can be cast to a desired type.
static Remote toStub(Remote obj)
          Returns a stub for the given server object.
static void unexportObject(Remote obj)
          Deregisters a server object from the runtime, 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
 

Constructor Detail

PortableRemoteObject

public PortableRemoteObject()
Method Detail

exportObject

public static void exportObject(Remote obj)
                         throws RemoteException
Makes a server object ready to receive remote calls.

Parameters:
obj - the server object to export.
Throws:
RemoteException - if export fails.

toStub

public static Remote toStub(Remote obj)
                     throws NoSuchObjectException
Returns a stub for the given server object.

Parameters:
obj - the server object for which a stub is required. Must either be a subclass of PortableRemoteObject or have been previously the target of a call to PortableRemoteObject.exportObject(java.rmi.Remote).
Returns:
the most derived stub for the object.
Throws:
NoSuchObjectException - if a stub cannot be located for the given server object.

unexportObject

public static void unexportObject(Remote obj)
                           throws NoSuchObjectException
Deregisters a server object from the runtime, allowing the object to become available for garbage collection.

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

narrow

public static Object narrow(Object narrowFrom,
                            Class narrowTo)
                     throws ClassCastException
Checks to ensure that an object of a remote or abstract interface type can be cast to a desired type.

Parameters:
narrowFrom - the object to check.
narrowTo - the desired type.
Returns:
an object which can be cast to the desired type.
Throws:
ClassCastException - if narrowFrom cannot be cast to narrowTo.

Documentation is available at
http://edocs.bea.com/wls/docs103
Copyright 2008 Oracle