JAC project
AOPSYS
CEDRIC & LIP6 labs

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

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

public class CORBARemoteContainer
extends RemoteContainer

CORBARemoteContainer is a container for remote objects that can be accessed with CORBA. CORBARemoteContainer instances are created by CORBADistd.

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

Field Summary
 
Fields inherited from class org.objectweb.jac.core.dist.RemoteContainer
name, verbose
 
Constructor Summary
CORBARemoteContainer(boolean verbose)
          Create a new container.
CORBARemoteContainer(String className, boolean verbose)
          Create a new container.
 
Method Summary
 void copy(int index, String[] fields, byte[][] state)
          Copy a state into a base object.
 byte[] getClientStubWrappingChain2(int index)
          Get a client stub wrapping chain for a given object.
 int instantiates(String className, byte[][] args, byte[] classes, String[] fields, byte[][] state)
          This method instantiates a className object.
 byte[] invoke(int index, String methodName, byte[][] 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
 

Constructor Detail

CORBARemoteContainer

public CORBARemoteContainer(boolean verbose)
Create a new container.

Parameters:
verbose - true if information messages are to be printed.

CORBARemoteContainer

public CORBARemoteContainer(String className,
                            boolean verbose)
Create a new container.

Parameters:
className - the name of a class to instantiate
verbose - true if information messages are to be printed.
Method Detail

instantiates

public int instantiates(String className,
                        byte[][] args,
                        byte[] classes,
                        String[] fields,
                        byte[][] 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 CORBARemoteContainerInterf 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,
                 byte[][] state)
Copy a state into a base object.

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

invoke

public byte[] invoke(int index,
                     String methodName,
                     byte[][] 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 a remote container. This method is part of the CORBARemoteContainerInterf interface.

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

getClientStubWrappingChain2

public byte[] getClientStubWrappingChain2(int index)
Get a client stub wrapping chain for a given object. This method is part of the CORBADistdInterf interface. 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. CORBARemoteContainer.getClientStubWrappingChain2 has a different return type than RemoteContainer.getClientStubWrappingChain (byte[] instead of Vector). Nevertheless, the latter is supposed to be the super method of the former. But because polymorphism on return type is not handled in Java, The method is called getClientStubWrappingChain2 instead of getClientStubWrappingChain.

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