org.objectweb.proactive.core.group
Class ProActiveGroup

java.lang.Object
  |
  +--org.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 a Group corresponding to the Object o representing a group.
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 member.
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 newGroupBuildWithMultithreading(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 newGroupBuildWithMultithreading(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 newGroupBuildWithMultithreading(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 newGroupBuildWithMultithreading(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 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 one future is arrived and get it.
static java.lang.Object waitAndGetTheNth(java.lang.Object o, int n)
          Wait 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)
          Wait 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 a Group corresponding to the Object o representing a group. Return null if o does not representing a group.

Returns:
the Group corresponding to o.

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.

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 member.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

newGroupBuildWithMultithreading

public static java.lang.Object newGroupBuildWithMultithreading(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.

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

newGroupBuildWithMultithreading

public static java.lang.Object newGroupBuildWithMultithreading(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.

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

newGroupBuildWithMultithreading

public static java.lang.Object newGroupBuildWithMultithreading(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.

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

newGroupBuildWithMultithreading

public static java.lang.Object newGroupBuildWithMultithreading(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.

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.


waitOne

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


waitN

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


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).

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).

Returns:
true if all the members of o are arrived.

waitAndGetOne

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

Returns:
a member of o.

waitTheNth

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


waitAndGetTheNth

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

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.

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.

Returns:
the number of member of the typed group o.

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.

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).

Returns:
true if o is a typed group.

setScatterGroup

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


unsetScatterGroup

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


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.


unsetUniqueSerialization

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


isScatterGroupOn

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

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


Copyright © April 2004 INRIA All Rights Reserved.