org.objectweb.carol.irmi
Class PRO

java.lang.Object
  extended byorg.objectweb.carol.irmi.PRO
All Implemented Interfaces:
javax.rmi.CORBA.PortableRemoteObjectDelegate

public class PRO
extends java.lang.Object
implements javax.rmi.CORBA.PortableRemoteObjectDelegate

The PRO class implements the PortableRemoteObjectDelegate interfaced provided by the javax.rmi.CORBA package as a plugin point for RMI implementations. In order to use this RMI implementation simply set the system property javax.rmi.CORBA.PortableRemoteObjectClass to the name of this class.

By default this class uses a Server instance on a random port with no Interceptors. If this behavior needs to be customized, this class may be subclassed by another class with a noargs constructor that invokes the PRO(Server) constructor with a Server instance that has been initialized with the desired Interceptor implementations and/or port. For example:

   public class MyPRO extends PRO {
       public MyPRO() {
           super(new Server(new MyClientInterceptor(), new MyServerInterceptor()));
       }
   }
 
   java -Djavax.rmi.CORBA.PortableRemoteObjectClass=MyPRO MyApp
 

Author:
Rafael H. Schloming <rhs@mit.edu>
See Also:
Server.Server(ClientInterceptor, Interceptor), Server.Server(int, ClientInterceptor, Interceptor)

Constructor Summary
  PRO()
          This is the public noargs constructor used by the RMI runtime to create an instance of this class when it is used directly.
protected PRO(Server server)
          Constructs a new PRO instance with the given Server.
 
Method Summary
 void connect(java.rmi.Remote target, java.rmi.Remote source)
           
 void exportObject(java.rmi.Remote obj)
           
 java.lang.Object narrow(java.lang.Object narrowFrom, java.lang.Class narrowTo)
           
 java.rmi.Remote toStub(java.rmi.Remote obj)
           
 void unexportObject(java.rmi.Remote obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PRO

protected PRO(Server server)
Constructs a new PRO instance with the given Server. This constructor is for use by subclasses wishing to use a customized Server instance.

Parameters:
server - the Server used by this PRO instance

PRO

public PRO()
This is the public noargs constructor used by the RMI runtime to create an instance of this class when it is used directly.

Method Detail

connect

public void connect(java.rmi.Remote target,
                    java.rmi.Remote source)
             throws java.rmi.RemoteException
Specified by:
connect in interface javax.rmi.CORBA.PortableRemoteObjectDelegate
Throws:
java.rmi.RemoteException

exportObject

public void exportObject(java.rmi.Remote obj)
                  throws java.rmi.RemoteException
Specified by:
exportObject in interface javax.rmi.CORBA.PortableRemoteObjectDelegate
Throws:
java.rmi.RemoteException

narrow

public java.lang.Object narrow(java.lang.Object narrowFrom,
                               java.lang.Class narrowTo)
Specified by:
narrow in interface javax.rmi.CORBA.PortableRemoteObjectDelegate

toStub

public java.rmi.Remote toStub(java.rmi.Remote obj)
                       throws java.rmi.NoSuchObjectException
Specified by:
toStub in interface javax.rmi.CORBA.PortableRemoteObjectDelegate
Throws:
java.rmi.NoSuchObjectException

unexportObject

public void unexportObject(java.rmi.Remote obj)
                    throws java.rmi.NoSuchObjectException
Specified by:
unexportObject in interface javax.rmi.CORBA.PortableRemoteObjectDelegate
Throws:
java.rmi.NoSuchObjectException