org.objectweb.jac.core.dist
Class Deployment

java.lang.Object
  extended byorg.objectweb.jac.core.dist.Deployment
All Implemented Interfaces:
Serializable

public class Deployment
extends Object
implements Serializable

This class deploies a set of objects on a set of host given a deployment mapping style (a function that gives the objects location in the topology).

It can be used by an aspect component that would implement a distribution aspect.

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

Constructor Summary
Deployment(AspectComponent ac, Topology topology)
          Creates a new deployment.
 
Method Summary
 RemoteRef[] deploy(Object[] objects)
          Equals to deploy( objects, false ).
 RemoteRef[] deploy(Object[] objects, boolean forward)
          Deploys a set of JAC object that are centralized on the local host to the Topology.
 RemoteRef[] deployStruct(Object[] objects)
          Equals to deployStruct( objects, false ).
 RemoteRef[] deployStruct(Object[] objects, boolean forward)
          Deploys a set of JAC object that are centralized on the local host to the Topology.
 RemoteRef[] replicate(Object object)
          Equals to replicate( object, -1 ).
 RemoteRef[] replicate(Object object, int forwardTo)
          Replicates a JAC object that is located on the local host to the hosts of the Topology.
 RemoteRef[] replicateStruct(Object object)
          Equals to replicateStruct( object, -1 ).
 RemoteRef[] replicateStruct(Object object, int forwardTo)
          Replicates a JAC object that is located on the local host to the hosts of the Topology.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deployment

public Deployment(AspectComponent ac,
                  Topology topology)
Creates a new deployment. For the moment, only the MS_ONE2ONE is available. Anyway, it is the most usual strategy.

Parameters:
topology - the topology used by the deployment
Method Detail

deployStruct

public RemoteRef[] deployStruct(Object[] objects,
                                boolean forward)
Deploys a set of JAC object that are centralized on the local host to the Topology.

Do not copy the state of the objects.

Parameters:
objects - a set of object to deploy on the topology
forward - if true, create a stub wrapper on each local object that forwards all the calls to the remotly deployed objects
Returns:
remote references on the deployed objects
See Also:
deploy(Object[],boolean)

deployStruct

public RemoteRef[] deployStruct(Object[] objects)
Equals to deployStruct( objects, false ).

Parameters:
objects - the object to deploy
Returns:
the array of the remote references pointing on the deployed objects
See Also:
deploy(Object[],boolean)

deploy

public RemoteRef[] deploy(Object[] objects,
                          boolean forward)
Deploys a set of JAC object that are centralized on the local host to the Topology. This is a static deployment and the references between the different local objects must have already been built (it means that the application must have been initialized in a centralized way.

Parameters:
objects - a set of object to deploy on the topology
forward - if true, create a stub wrapper on each local object that forwards all the calls to the remotly deployed objects
Returns:
remote references on the deployed objects
See Also:
deployStruct(Object[],boolean)

deploy

public RemoteRef[] deploy(Object[] objects)
Equals to deploy( objects, false ).

Parameters:
objects - the object to deploy
Returns:
the array of the remote references pointing on the deployed objects
See Also:
deploy(Object[],boolean)

replicate

public RemoteRef[] replicate(Object object,
                             int forwardTo)
Replicates a JAC object that is located on the local host to the hosts of the Topology.

Parameters:
object - the local object to replicate
forwardTo - the index of the topology where the local object will forward the calls (if -1 or not valid for the topology then do not forward any call)
Returns:
remote references on the replicated objects
See Also:
replicateStruct(Object,int)

replicate

public RemoteRef[] replicate(Object object)
Equals to replicate( object, -1 ).

Parameters:
object - the object to replicate
Returns:
the array of the remote references pointing on the replicated objects
See Also:
replicate(Object,int)

replicateStruct

public RemoteRef[] replicateStruct(Object object,
                                   int forwardTo)
Replicates a JAC object that is located on the local host to the hosts of the Topology.

Do not copy the objects states.

Parameters:
object - the local object to replicate
forwardTo - the index of the topology where the local object will forward the calls (if -1 or not valid for the topology then do not forward any call)
Returns:
remote references on the replicated objects
See Also:
replicate(Object,int)

replicateStruct

public RemoteRef[] replicateStruct(Object object)
Equals to replicateStruct( object, -1 ).

Parameters:
object - the object to replicate
Returns:
the array of the remote references pointing on the replicated objects
See Also:
replicateStruct(Object,int)