JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.core.dist.corba
Class CORBARemoteContainerStub

java.lang.Object
  |
  +--org.objectweb.jac.core.dist.RemoteContainer
        |
        +--org.objectweb.jac.core.dist.corba.CORBARemoteContainerStub
All Implemented Interfaces:
Serializable

public class CORBARemoteContainerStub
extends RemoteContainer
implements Serializable

CORBARemoteContainerStub acts as a client stub to access a remote container. CORBARemoteContainerStub holds a CORBARemoteContainerInterf instance. This is the client stub of the remote CORBARemoteContainer object that owns as a delegate the container that is to be accessed.

Note: what we need is an instance of something that extends RemoteContainer. But we can't have an object that is both a client stub for a remote CORBA object and a RemoteContainer (no multiple inheritance in Java). So we implemented this delegating scheme where:

Author:
Renaud Pawlak, Lionel Seinturier
See Also:
CORBARemoteContainer, Serialized Form

Field Summary
protected  CORBARemoteContainerInterf delegate
          The CORBA stub where the job is to be delegated.
 
Fields inherited from class org.objectweb.jac.core.dist.RemoteContainer
name, verbose
 
Constructor Summary
CORBARemoteContainerStub(CORBARemoteContainerInterf delegate)
          Create a new remote container stub.
 
Method Summary
 void copy(int index, String[] fields, Object[] state)
          Copy a state into a base object.
 Vector getClientStubWrappingChain(int index)
          Get a client stub wrapping chain for a given object.
 int instantiates(String className, Object[] args, Vector classes, String[] fields, Object[] state)
          This method instantiates a className object.
 Object invoke(int index, String methodName, Object[] methodArgs)
          Invoke a method on a base object.
 
Methods inherited from class org.objectweb.jac.core.dist.RemoteContainer
bindNewContainer, bindTo, copy, equals, getByteCodeFor, getName, instantiates, invoke, invokeRoleMethod, isLocal, isLocal, launchRemoteGUI, resolve, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate

protected CORBARemoteContainerInterf delegate
The CORBA stub where the job is to be delegated.

Constructor Detail

CORBARemoteContainerStub

public CORBARemoteContainerStub(CORBARemoteContainerInterf delegate)
Create a new remote container stub.

Parameters:
delegate - the stub where the job is to be delegated
Method Detail

instantiates

public int instantiates(String className,
                        Object[] args,
                        Vector classes,
                        String[] fields,
                        Object[] state)
This method instantiates a className object. Clients call it to remotely instantiate an object. instantiates creates an object and returns its index. This method is part of the RMIDistdInterf interface.

Parameters:
className - the class name to instantiate
args - initialization arguments for the instantiation
classes - remote classes to load
fields - the object fields that are part of the state
state - the state to copy
Returns:
the index of the className object

copy

public void copy(int index,
                 String[] fields,
                 Object[] state)
Copy a state into a base object.

Parameters:
index - the callee index (see org.objectweb.jac.core.JacObject)
fields - the object fields that are part of the state
state - the state to copy

invoke

public Object invoke(int index,
                     String methodName,
                     Object[] methodArgs)
Invoke a method on a base object. The base object is the remote counterpart of a local object that has been remotely instantiated by the org.objectweb.jac.dist.Distd daemon.

Parameters:
index - the callee index (see org.objectweb.jac.core.JacObject)
methodName - the callee method name
methodArgs - the callee method arguments
Returns:
the result

getClientStubWrappingChain

public Vector getClientStubWrappingChain(int index)
Get a client stub wrapping chain for a given object. This method is called whenever a daemon receives as a parameter a reference to a remote object, to get the wrapping chain (for instance an authentication wrapper, a verbose wrapper, ...) needed to create a client stub for this remote reference.

Parameters:
index - the base object index (see org.objectweb.jac.core.JacObject)
Returns:
the client stub wrapping chain as a serialized object

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli