org.objectweb.proactive.core.group
Class ProActiveGroup

java.lang.Object
  extended byorg.objectweb.proactive.core.group.ProActiveGroup

public class ProActiveGroup
extends java.lang.Object

This class provides static methods to manage objects representing a Group (typed group).

The ProActiveGroup class provides a set of static services through static method calls. It is the main entry point for users of ProActive Group Communication as they will call methods of this class to create group of object or to synchronize them.

The main role of ProActiveGroup is to provide methods to create typed group. It is possible to create a typed group (empty or not) through instantiation using one of the version of newActive. It is also possible to create an active typed group from an existing using using the turnActive methods.
The default behavior is a broadcast call, with a unique serialization of parameters.

Warning !!! When a typed group is turned active, it looses the ability to switch to the Group representation. So an active typed group acquire the abilites of any active object (remote reference, migration, ...) but is no more able to evolve : no modification of the membership is possible.
(This feature will may appear in a later version of ProActive group communication).

Author:
Laurent Baduel

Field Summary
static java.lang.Class DEFAULT_PROXYFORGROUP_CLASS
          The name of the default proxy for group communication
static java.lang.String DEFAULT_PROXYFORGROUP_CLASS_NAME
          The name of the default proxy for group communication
protected static org.apache.log4j.Logger logger
          The logger for the Class
 
Method Summary
static boolean allArrived(java.lang.Object o)
          Tests if all the member of the object o representing a group are arrived or not.
static boolean allAwaited(java.lang.Object o)
          Tests if all the members of the object o representing a group are awaited or not.
static java.lang.Object captureView(java.lang.Object ogroup)
          Gives a view of the group
static java.lang.Object get(java.lang.Object o, int n)
          Returns the member at the specified index of the object representing a Group.
static Group getGroup(java.lang.Object o)
          Returns the Group for typed group o.
static java.lang.String getType(java.lang.Object o)
          Returns the name class of the typed group.
static boolean isGroup(java.lang.Object o)
          Checks if the object o is an object representing a Group (future or not).
static boolean isScatterGroupOn(java.lang.Object ogroup)
          Checks the semantic of communication of the typed group ogroup.
static java.lang.Object newGroup(java.lang.String className)
          Creates an object representing an empty group specifying the upper class of members.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[][] params)
          Creates an object representing a group (a typed group) and creates members on the default node.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[][] params, Node node)
          Creates an object representing a group (a typed group) and creates all members with params on the node.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[][] params, Node[] nodeList)
          Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[][] params, java.lang.String nodeName)
          Creates an object representing a group (a typed group) and creates all members with params on the node.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[][] params, java.lang.String[] nodeListString)
          Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[][] params, VirtualNode virtualNode)
          Creates an object representing a group (a typed group) and creates members with params cycling on the nodes of the virtual node.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[] params, Node node)
          Creates an object representing a group (a typed group) and creates all members with the same params on the node.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[] params, Node[] nodeList)
          Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[] params, java.lang.String nodeName)
          Creates an object representing a group (a typed group) and creates all members with the same params on the node.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[] params, java.lang.String[] nodeListString)
          Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.
static java.lang.Object newGroup(java.lang.String className, java.lang.Object[] params, VirtualNode virtualNode)
          Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.
static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className, java.lang.Object[][] params)
          Creates an object representing a group (a typed group) and creates members on the default node.
static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className, java.lang.Object[][] params, Node[] nodeList)
          Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.
static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className, java.lang.Object[][] params, java.lang.String[] nodeList)
          Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.
static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className, java.lang.Object[][] params, VirtualNode virtualNode)
          Creates an object representing a group (a typed group) and creates members with params cycling on the nodes of the vitual node.
static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className, java.lang.Object[] params, Node[] nodeList)
          Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.
static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className, java.lang.Object[] params, java.lang.String[] nodeList)
          Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.
static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className, java.lang.Object[] params, VirtualNode virtualNode)
          Creates an object representing a group (a typed group) and creates members with the same params cycling on the nodes of the vitual node.
static void setScatterGroup(java.lang.Object ogroup)
          Allows the typed group to dispatch parameters
static void setUniqueSerialization(java.lang.Object ogroup)
          Allows the typed group to make an unique serialization of parameters when a broadcast call occurs.
static int size(java.lang.Object o)
          Returns the number of members of the object representing a Group.
static java.lang.Object turnActiveGroup(java.lang.Object ogroup)
          Turns the target object (a typed group) into an ActiveObject (an active typed group) attached to a default node in the local JVM.
static java.lang.Object turnActiveGroup(java.lang.Object ogroup, Node node)
          Turns the target object (a typed group) into an ActiveObject (an active typed group) attached to a specified node.
static java.lang.Object turnActiveGroup(java.lang.Object ogroup, java.lang.String nodeName)
          Turns the target object (a typed group) into an ActiveObject (an active typed group) attached to a specified node.
static void unsetScatterGroup(java.lang.Object ogroup)
          Allows the typed group to broadcast parameters
static void unsetUniqueSerialization(java.lang.Object ogroup)
          Removes the ability of a typed group to make an unique serialization
static void waitAll(java.lang.Object o)
          Waits for all the futures are arrived.
static java.lang.Object waitAndGetOne(java.lang.Object o)
          Waits for one future is arrived and get it.
static java.lang.Object waitAndGetOneThenRemoveIt(java.lang.Object o)
          Waits for one future is arrived and returns it (removes it from the typed group).
static java.lang.Object waitAndGetTheNth(java.lang.Object o, int n)
          Waits for the N-th future is arrived and get it.
static void waitN(java.lang.Object o, int n)
          Waits n futures are arrived.
static void waitOne(java.lang.Object o)
          Waits for (at least) one future is arrived.
 int waitOneAndGetIndex(java.lang.Object o)
          Waits that at least one member is arrived and returns its index.
static void waitTheNth(java.lang.Object o, int n)
          Waitd for the N-th future in the list is arrived.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
The logger for the Class


DEFAULT_PROXYFORGROUP_CLASS

public static final java.lang.Class DEFAULT_PROXYFORGROUP_CLASS
The name of the default proxy for group communication


DEFAULT_PROXYFORGROUP_CLASS_NAME

public static final java.lang.String DEFAULT_PROXYFORGROUP_CLASS_NAME
The name of the default proxy for group communication

See Also:
Constant Field Values
Method Detail

getGroup

public static Group getGroup(java.lang.Object o)
Returns the Group for typed group o. Returns null if o is not a typed group.

Parameters:
o - - the typed group.
Returns:
the Group corresponding to o. null if o is not a typed group.

getType

public static java.lang.String getType(java.lang.Object o)
Returns the name class of the typed group. If the parameter is not a typed group, returns the name of Class of the parameter.

Parameters:
o - the typed group for wich we want the name of the type (Class).
Returns:
the name class of the typed group

newGroup

public static java.lang.Object newGroup(java.lang.String className)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException
Creates an object representing an empty group specifying the upper class of members.

Parameters:
className - the name of the (upper) class of the group's members.
Returns:
an empty group of type className.
Throws:
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[][] params)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates members on the default node.

Parameters:
className - the name of the (upper) class of the group's members.
params - the array that contain the parameters used to build the group's members. If params is null, builds an empty group.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[][] params,
                                        java.lang.String nodeName)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates all members with params on the node.

Parameters:
className - the name of the (upper) class of the group's members.
params - the array that contain the parameters used to build the group's members.
nodeName - the name (String) of the node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[][] params,
                                        java.lang.String[] nodeListString)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.

Parameters:
className - the name of the (upper) class of the group's members.
params - the array that contain the parameters used to build the group's members.
nodeListString - the names of the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[][] params,
                                        Node node)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates all members with params on the node.

Parameters:
className - the name of the (upper) class of the group's members.
params - the array that contain the parameters used to build the group's members.
node - the node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[][] params,
                                        Node[] nodeList)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.

Parameters:
className - the name of the (upper) class of the group's members.
params - the array that contain the parameters used to build the group's members. If params is null, builds an empty group.
nodeList - the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[][] params,
                                        VirtualNode virtualNode)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates members with params cycling on the nodes of the virtual node.

Parameters:
className - the name of the (upper) class of the group's members.
params - the array that contain the parameters used to build the group's members. If params is null, builds an empty group.
virtualNode - the virtual where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[] params,
                                        Node[] nodeList)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.

Parameters:
className - the name of the (upper) class of the group's members.
params - the parameters used to build all the group's members.
nodeList - the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[] params,
                                        VirtualNode virtualNode)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.

Parameters:
className - the name of the (upper) class of the group's members.
params - the parameters used to build all the group's members.
virtualNode - the virtual node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[] params,
                                        Node node)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates all members with the same params on the node.

Parameters:
className - the name of the (upper) class of the group's members.
params - the parameters used to build all the group's members.
node - the node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[] params,
                                        java.lang.String nodeName)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates all members with the same params on the node.

Parameters:
className - the name of the (upper) class of the group's members.
params - the parameters used to build all the group's members.
nodeName - the name of the node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroup

public static java.lang.Object newGroup(java.lang.String className,
                                        java.lang.Object[] params,
                                        java.lang.String[] nodeListString)
                                 throws java.lang.ClassNotFoundException,
                                        ClassNotReifiableException,
                                        ActiveObjectCreationException,
                                        NodeException
Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList.

Parameters:
className - the name of the (upper) class of the group's members.
params - the parameters used to build all the group's members.
nodeListString - the names of the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

turnActiveGroup

public static java.lang.Object turnActiveGroup(java.lang.Object ogroup)
                                        throws java.lang.ClassNotFoundException,
                                               ClassNotReifiableException,
                                               ActiveObjectCreationException,
                                               NodeException
Turns the target object (a typed group) into an ActiveObject (an active typed group) attached to a default node in the local JVM.

Parameters:
ogroup - the typed group to turn active.
Returns:
a reference on the active object produced.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created.

turnActiveGroup

public static java.lang.Object turnActiveGroup(java.lang.Object ogroup,
                                               Node node)
                                        throws java.lang.ClassNotFoundException,
                                               ClassNotReifiableException,
                                               ActiveObjectCreationException,
                                               NodeException
Turns the target object (a typed group) into an ActiveObject (an active typed group) attached to a specified node.

Parameters:
ogroup - the typed group to turn active.
node - the node where to create the active object on. If null, the active object is created localy on a default node
Returns:
a reference (possibly remote) on the active object produced.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the specified node can not be reached.

turnActiveGroup

public static java.lang.Object turnActiveGroup(java.lang.Object ogroup,
                                               java.lang.String nodeName)
                                        throws java.lang.ClassNotFoundException,
                                               ClassNotReifiableException,
                                               ActiveObjectCreationException,
                                               NodeException
Turns the target object (a typed group) into an ActiveObject (an active typed group) attached to a specified node.

Parameters:
ogroup - the typed group to turn active.
nodeName - the name of the node where to create the active object on.
Returns:
a reference (possibly remote) on the active object produced.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the specified node can not be reached.

newGroupBuiltWithMultithreading

public static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className,
                                                               java.lang.Object[][] params)
                                                        throws java.lang.ClassNotFoundException,
                                                               ClassNotReifiableException,
                                                               ActiveObjectCreationException,
                                                               NodeException
Creates an object representing a group (a typed group) and creates members on the default node.

Parameters:
className - the name of the (upper) class of the group's member.
params - the array that contain the parameters used to build the group's member. If params is null, builds an empty group.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroupBuiltWithMultithreading

public static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className,
                                                               java.lang.Object[][] params,
                                                               Node[] nodeList)
                                                        throws java.lang.ClassNotFoundException,
                                                               ClassNotReifiableException,
                                                               ActiveObjectCreationException,
                                                               NodeException
Creates an object representing a group (a typed group) and creates members with params cycling on nodeList. Threads are used to build the group's members. This methods returns when all members were created.

Parameters:
className - the name of the (upper) class of the group's member.
params - the array that contain the parameters used to build the group's member.
nodeList - the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroupBuiltWithMultithreading

public static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className,
                                                               java.lang.Object[][] params,
                                                               java.lang.String[] nodeList)
                                                        throws java.lang.ClassNotFoundException,
                                                               ClassNotReifiableException,
                                                               ActiveObjectCreationException,
                                                               NodeException
Creates an object representing a group (a typed group) and creates members with params cycling on nodeList. Threads are used to build the group's members. This methods returns when all members were created.

Parameters:
className - the name of the (upper) class of the group's member.
params - the array that contain the parameters used to build the group's member. If params is null, builds an empty group.
nodeList - the names of the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroupBuiltWithMultithreading

public static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className,
                                                               java.lang.Object[][] params,
                                                               VirtualNode virtualNode)
                                                        throws java.lang.ClassNotFoundException,
                                                               ClassNotReifiableException,
                                                               ActiveObjectCreationException,
                                                               NodeException
Creates an object representing a group (a typed group) and creates members with params cycling on the nodes of the vitual node. Threads are used to build the group's members. This methods returns when all members were created.

Parameters:
className - the name of the (upper) class of the group's member.
params - the array that contain the parameters used to build the group's member. If params is null, builds an empty group.
virtualNode - the virtual node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroupBuiltWithMultithreading

public static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className,
                                                               java.lang.Object[] params,
                                                               java.lang.String[] nodeList)
                                                        throws java.lang.ClassNotFoundException,
                                                               ClassNotReifiableException,
                                                               ActiveObjectCreationException,
                                                               NodeException
Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList. Threads are used to build the group's members. This methods returns when all members were created.

Parameters:
className - the name of the (upper) class of the group's members.
params - the parameters used to build all the group's members. If params is null, builds an empty group.
nodeList - the names of the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroupBuiltWithMultithreading

public static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className,
                                                               java.lang.Object[] params,
                                                               Node[] nodeList)
                                                        throws java.lang.ClassNotFoundException,
                                                               ClassNotReifiableException,
                                                               ActiveObjectCreationException,
                                                               NodeException
Creates an object representing a group (a typed group) and creates members with the same params cycling on nodeList. Threads are used to build the group's members. This methods returns when all members were created.

Parameters:
className - the name of the (upper) class of the group's member.
params - the parameters used to build all the group's member.
nodeList - the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newGroupBuiltWithMultithreading

public static java.lang.Object newGroupBuiltWithMultithreading(java.lang.String className,
                                                               java.lang.Object[] params,
                                                               VirtualNode virtualNode)
                                                        throws java.lang.ClassNotFoundException,
                                                               ClassNotReifiableException,
                                                               ActiveObjectCreationException,
                                                               NodeException
Creates an object representing a group (a typed group) and creates members with the same params cycling on the nodes of the vitual node. Threads are used to build the group's members. This methods returns when all members were created.

Parameters:
className - the name of the (upper) class of the group's member.
params - the parameters used to build all the group's member. If params is null, builds an empty group.
virtualNode - the virtual node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

captureView

public static java.lang.Object captureView(java.lang.Object ogroup)
Gives a view of the group

Parameters:
ogroup - - a typed group
Returns:
a typed group, the view of the group

waitAll

public static void waitAll(java.lang.Object o)
Waits for all the futures are arrived.

Parameters:
o - a typed group.

waitOne

public static void waitOne(java.lang.Object o)
Waits for (at least) one future is arrived.

Parameters:
o - a typed group.

waitN

public static void waitN(java.lang.Object o,
                         int n)
Waits n futures are arrived.

Parameters:
o - a typed group.
n - the number of awaited members.

allAwaited

public static boolean allAwaited(java.lang.Object o)
Tests if all the members of the object o representing a group are awaited or not. Always returns false if o is not a reified object (future or group).

Parameters:
o - a typed group.
Returns:
true if all the members of o are awaited.

allArrived

public static boolean allArrived(java.lang.Object o)
Tests if all the member of the object o representing a group are arrived or not. Always returns true if o is not a reified object (future or group).

Parameters:
o - a typed group.
Returns:
true if all the members of o are arrived.

waitAndGetOne

public static java.lang.Object waitAndGetOne(java.lang.Object o)
Waits for one future is arrived and get it.

Parameters:
o - a typed group.
Returns:
a member of o.

waitAndGetOneThenRemoveIt

public static java.lang.Object waitAndGetOneThenRemoveIt(java.lang.Object o)
Waits for one future is arrived and returns it (removes it from the typed group).

Parameters:
o - a typed group.
Returns:
a member of o. (o is removed from the typed group)

waitTheNth

public static void waitTheNth(java.lang.Object o,
                              int n)
Waitd for the N-th future in the list is arrived.

Parameters:
o - a typed group.

waitAndGetTheNth

public static java.lang.Object waitAndGetTheNth(java.lang.Object o,
                                                int n)
Waits for the N-th future is arrived and get it.

Parameters:
o - a typed group.
n - the rank of the awaited member.
Returns:
the n-th member of th typed group o.

waitOneAndGetIndex

public int waitOneAndGetIndex(java.lang.Object o)
Waits that at least one member is arrived and returns its index.

Parameters:
o - a typed group.
Returns:
the index of a non-awaited member of the Group, -1 if o is not a reified object.

size

public static int size(java.lang.Object o)
Returns the number of members of the object representing a Group. Throws an IllegalArgumentException if o doesn't represent a Group.

Parameters:
o - a typed group.
Returns:
the number of member of the typed group o.
Throws:
java.lang.IllegalArgumentException - if the parameter doesn't represent a group

get

public static java.lang.Object get(java.lang.Object o,
                                   int n)
Returns the member at the specified index of the object representing a Group. Returns null if obj doesn't represent a Group.

Parameters:
o - a typed group.
n - the rank of the wanted member.
Returns:
the member of the typed group at the rank n

isGroup

public static boolean isGroup(java.lang.Object o)
Checks if the object o is an object representing a Group (future or not).

Parameters:
o - the Object to check.
Returns:
true if o is a typed group.

setScatterGroup

public static void setScatterGroup(java.lang.Object ogroup)
Allows the typed group to dispatch parameters

Parameters:
ogroup - the typed group who will change his semantic of communication.

unsetScatterGroup

public static void unsetScatterGroup(java.lang.Object ogroup)
Allows the typed group to broadcast parameters

Parameters:
ogroup - the typed group who will change his semantic of communication.

setUniqueSerialization

public static void setUniqueSerialization(java.lang.Object ogroup)
Allows the typed group to make an unique serialization of parameters when a broadcast call occurs.

Parameters:
ogroup - the typed group who will change his semantic of communication.

unsetUniqueSerialization

public static void unsetUniqueSerialization(java.lang.Object ogroup)
Removes the ability of a typed group to make an unique serialization

Parameters:
ogroup - the typed group who will change his semantic of communication.

isScatterGroupOn

public static boolean isScatterGroupOn(java.lang.Object ogroup)
Checks the semantic of communication of the typed group ogroup.

Parameters:
ogroup - a typed group.
Returns:
true if the "scatter option" is enabled for the typed group ogroup.


Copyright ? April 2005 INRIA All Rights Reserved.