|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.proactive.core.body.proxy.AbstractProxy
org.objectweb.proactive.core.group.ProxyForGroup
Field Summary | |
protected java.lang.String |
className
The name of the Class : all members of the group are "className" assignable |
protected boolean |
dispatching
Flag to deternime the semantic of communication (broadcast or dispatching) |
protected java.util.Map |
elementNames
The map : to name members of the group |
protected static org.apache.log4j.Logger |
logger
The logger for the Class |
protected java.util.Vector |
memberList
The list of member : it contains exclusively, StubObjects connected to Proxies, or Java Objects |
protected StubObject |
stub
The stub of the typed group |
protected boolean |
uniqueSerialization
Flag to deternime the semantic of communication (unique serialization of parameters or not) |
protected int |
waited
Number of awaited methodcall on the group's member. |
Constructor Summary | |
ProxyForGroup()
|
|
ProxyForGroup(ConstructorCall c,
java.lang.Object[] p)
|
|
ProxyForGroup(java.lang.String nameOfClass)
|
Method Summary | |
boolean |
add(java.lang.Object o)
If o is a reified object and if it is "assignableFrom" the class of the group, add it into the group - if o is a group merge it into the group - if o is not a reified object nor a group : do nothing |
boolean |
addAll(java.util.Collection c)
Adds all of the elements in the specified Collection to this Group. |
void |
addMerge(java.lang.Object oGroup)
Add all member of the group ogroup into the Group. |
void |
addNamedElement(java.lang.String key,
java.lang.Object value)
Associates the specified value with the specified key in this Group (optional operation). |
protected void |
addToListOfResult(java.util.Vector memberListOfResultGroup,
java.lang.Object result,
int index)
Add the results (Future) into the typed group result at the correct poisition. |
boolean |
allArrived()
Checks if all the members of the Group are arrived. |
boolean |
allAwaited()
Checks if all the members of the Group are awaited. |
protected java.lang.Object |
asynchronousCallOnGroup(MethodCall mc)
Creates and initializes (and returns) the group of result, then launch threads for asynchronous call of each member. |
void |
clear()
Removes all of the elements from this group. |
boolean |
contains(java.lang.Object o)
This method returns true if and only if this group contains at least one element e such that o.equals(e) |
boolean |
containsAll(java.util.Collection c)
Checks if this Group contains all of the elements in the specified collection. |
boolean |
containsKey(java.lang.String key)
Returns true if this Group contains a mapping for the specified key.
|
boolean |
containsValue(java.lang.Object value)
Returns true if this Group maps one or more keys to the specified value.
|
protected void |
createMemberWithMultithread(java.lang.String className,
java.lang.Object[][] params,
java.lang.String[] nodeList)
Builds the members using the threads (of the threadpool). |
protected void |
createMemberWithMultithread(java.lang.String className,
java.lang.Object[] params,
java.lang.String[] nodeList)
Builds the members using the threads (of the threadpool). |
Group |
difference(Group g)
Creates a new group with all members that belong to the group or to the group g , but not to both. |
void |
display()
To debug, display the size of the Group and all its members with there position |
boolean |
equals(java.lang.Object o)
Compares the specified object with this group for equality. |
Group |
exclude(Group g)
Creates a new group with the members that belong to the group, but not to the group g . |
void |
finalize()
Explicit destructor : Interrupts the threads in the threadpool |
java.lang.Object |
get(int i)
Returns the i-th member of the group. |
ExceptionList |
getExceptionList()
Returns an ExceptionList containing all the throwables (exceptions and errors) occured when this group was built |
java.lang.Object |
getGroupByType()
Returns an Object (a typed group Object) representing the Group |
java.lang.Object |
getNamedElement(java.lang.String key)
Returns the Object to which this Group maps the specified key. |
java.lang.Class |
getType()
Returns the ("higher") Class of group's member. |
java.lang.String |
getTypeName()
Returns the full name of ("higher") Class of group's member |
int |
hashCode()
Returns the hash code value for this Group. |
int |
indexOf(java.lang.Object obj)
Returns the index of the first occurence of the specified Object obj . |
Group |
intersection(Group g)
Creates a new group with all members that belong to the group and to the group g . |
protected boolean |
isDispatchingOn()
Checks the semantic of communication of the Group. |
boolean |
isEmpty()
Check if the group is empty. |
java.util.Iterator |
iterator()
Returns an Iterator of the member in the Group. |
java.util.Set |
keySet()
Returns a set view of the keys contained in this Group. |
java.util.ListIterator |
listIterator()
Returns a list iterator of the members in this Group (in proper sequence). |
protected void |
oneWayCallOnGroup(MethodCall mc,
ExceptionList exceptionList)
Launchs the threads for OneWay call of each member of the Group. |
void |
purgeExceptionAndNull()
Removes all exceptions and null references contained in the Group. |
Group |
range(int begin,
int end)
Creates a new group with the members of the group begining at the index begin and ending at the index end . |
java.lang.Object |
reify(MethodCall mc)
The proxy's method : implements the semantic of communication. |
java.lang.Object |
remove(int index)
Removes the element at the specified position. |
boolean |
remove(java.lang.Object o)
Removes a single instance of the specified element from this Group, if it is present. |
boolean |
removeAll(java.util.Collection c)
Removes all this Group's elements that are also contained in the specified collection. |
java.lang.Object |
removeNamedElement(java.lang.String key)
Removes the named element of the group. |
boolean |
retainAll(java.util.Collection c)
Retains only the elements in this Group that are contained in the specified collection. |
void |
set(int index,
java.lang.Object o)
Sets an object to the specified position in the Group |
void |
setAdditionalThread(int i)
Modifies the number of additional threads to serve members |
protected void |
setDispatchingOff()
Allows the Group to broadcast parameters. |
protected void |
setDispatchingOn()
Allows the Group to dispatch parameters. |
void |
setRatioMemberToThread(int i)
Modifies the number of members served by one thread |
void |
setSPMDGroup(java.lang.Object spmdGroup)
Communicates the SPMD Group to members |
protected void |
setUniqueSerializationOff()
Removes the ability of the Group to make an unique serialization of parameters.. |
protected void |
setUniqueSerializationOn()
Allows the Group to make an unique serialization of parameters. |
int |
size()
Returns the number of member in this Group. |
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this Group in the correct order. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. |
Group |
union(Group g)
Creates a new group with all members of the group and all the members of the group g |
void |
waitAll()
Waits for all members are arrived. |
java.lang.Object |
waitAndGetOne()
Waits for at least one member is arrived and returns it. |
java.lang.Object |
waitAndGetOneThenRemoveIt()
Waits for one future is arrived and returns it (removes it from the group). |
java.lang.Object |
waitAndGetTheNth(int n)
Waits for the member at the specified rank is arrived and returns it. |
void |
waitN(int n)
Waits for at least n members are arrived. |
void |
waitOne()
Waits for at least one member is arrived. |
int |
waitOneAndGetIndex()
Waits for at least one member is arrived and returns its index. |
void |
waitTheNth(int n)
Waits for the member at the specified rank is arrived. |
Methods inherited from class org.objectweb.proactive.core.body.proxy.AbstractProxy |
clearHandlersLevel, getHandlerizableInfo, getHandlersLevel, isAsynchronousCall, isOneWayCall, setExceptionHandler, unsetExceptionHandler |
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.proactive.core.exceptions.Handlerizable |
clearHandlersLevel, getHandlerizableInfo, getHandlersLevel, setExceptionHandler, unsetExceptionHandler |
Field Detail |
protected static org.apache.log4j.Logger logger
protected java.lang.String className
protected java.util.Vector memberList
protected java.util.Map elementNames
protected int waited
protected boolean dispatching
protected boolean uniqueSerialization
protected StubObject stub
Constructor Detail |
public ProxyForGroup(java.lang.String nameOfClass) throws ConstructionOfReifiedObjectFailedException
public ProxyForGroup() throws ConstructionOfReifiedObjectFailedException
public ProxyForGroup(ConstructorCall c, java.lang.Object[] p) throws ConstructionOfReifiedObjectFailedException
Method Detail |
protected void setDispatchingOn()
protected void setDispatchingOff()
protected void setUniqueSerializationOn()
protected void setUniqueSerializationOff()
protected boolean isDispatchingOn()
true
if the "scatter option" is enabled.public java.lang.Object reify(MethodCall mc) throws java.lang.reflect.InvocationTargetException
mc
on each members of the Group.
reify
in interface Proxy
mc
- the MethodCall to apply on each member of the Group.
java.lang.reflect.InvocationTargetException
- if a problem occurs when invoking the method on the members of the Grouppublic void finalize()
protected java.lang.Object asynchronousCallOnGroup(MethodCall mc)
mc
- the MethodCall to be applied on each member of the Group.
protected void addToListOfResult(java.util.Vector memberListOfResultGroup, java.lang.Object result, int index)
memberListOfResultGroup
- the list of the typed group result.result
- the result of a call on member of a Group.index
- the rank of the result.protected void oneWayCallOnGroup(MethodCall mc, ExceptionList exceptionList)
mc
- the MethodCall to be applied on each member of the Group.public boolean add(java.lang.Object o)
add
in interface java.util.Collection
o
- - element whose presence in this group is to be ensured
true
if this collection changed as a result of the callpublic boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
c
- - the elements to be inserted into this Group.
true
if this collection changed as a result of the call.public void clear()
clear
in interface java.util.Collection
public boolean contains(java.lang.Object o)
o.equals(e)
contains
in interface java.util.Collection
true
if this collection contains the specified element.public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
c
- - the collection to be checked for containment in this Group.
true
if this Group contains all of the elements in the specified collectionpublic boolean equals(java.lang.Object o)
true
if and only if the specified Object o
is also a Group
, both Group
s have the same size,
and all corresponding pairs of elements in the two Group
s are equal.
(Two elements e1 and e2 are equal if (e1==null ? e2==null : e1.equals(e2)
).
In other words, two Group
s are defined to be equal if they contain the
same elements in the same order.
equals
in interface java.util.Collection
o
- the Object for wich we test the equality.
true
if o
is the same Group as this
.public int hashCode()
hashCode
in interface java.util.Collection
public boolean isEmpty()
isEmpty
in interface java.util.Collection
true
if this collection contains no elements.public java.util.Iterator iterator()
iterator
in interface java.util.Collection
public boolean remove(java.lang.Object o)
o.equals(e)
returns true
.
remove
in interface java.util.Collection
o
- the element to be removed from this Group (if present).
true> if the Group contained the specified element.
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
c
- - elements to be removed from this Group.
true
if this Group changed as a result of the callpublic boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
c
- - elements to be retained in this Group.
true
if this Group changed as a result of the call.public int size()
size
in interface java.util.Collection
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
a
- - the array into which the elements of this collection are to be stored, if it is big enough;
otherwise, a new array of the same runtime type is allocated for this purpose.
public void addMerge(java.lang.Object oGroup)
ogroup
into the Group. ogroup
can be :
addMerge
in interface Group
oGroup
- the object(s) to merge into the Group.public int indexOf(java.lang.Object obj)
obj
.
indexOf
in interface Group
obj
- - the obj tahat is searched in the Group.
obj
in the Group.
-1 if the list does not contain this object.public java.util.ListIterator listIterator()
listIterator
in interface Group
public java.lang.Object remove(int index)
remove
in interface Group
index
- the rank of the object to remove in the Group.
public java.lang.Object get(int i)
get
in interface Group
i
- - the rank of the object to return.
public java.lang.Class getType() throws java.lang.ClassNotFoundException
getType
in interface Group
java.lang.ClassNotFoundException
- if the class name of the Group is not known.public java.lang.String getTypeName()
getTypeName
in interface Group
public java.lang.Object getGroupByType()
getGroupByType
in interface Group
public Group union(Group g)
g
union
in interface Group
g
- - a group
g
. null if the class of the group is incompatible.
public Group intersection(Group g)
g
.
intersection
in interface Group
g
- - a group
g
. null if the class of the group is incompatible.
public Group exclude(Group g)
g
.
exclude
in interface Group
g
- - a group
g
. null if the class of the group is incompatible.
public Group difference(Group g)
g
, but not to both.
difference
in interface Group
g
- - a group
g
. null if the class of the group is incompatible.
public Group range(int begin, int end)
begin
and ending at the index end
.
range
in interface Group
begin
- - the begining indexend
- - the ending index
begin
to end
. null
if begin > end
.public void setSPMDGroup(java.lang.Object spmdGroup)
spmdGroup
- - the SPMD grouppublic void display()
public void waitAll()
waitAll
in interface Group
public void waitOne()
waitOne
in interface Group
public void waitTheNth(int n)
waitTheNth
in interface Group
n
- - the rank of the awaited member.public void waitN(int n)
n
members are arrived.
waitN
in interface Group
n
- - the number of awaited members.public java.lang.Object waitAndGetOne()
waitAndGetOne
in interface Group
public java.lang.Object waitAndGetOneThenRemoveIt()
waitAndGetOneThenRemoveIt
in interface Group
o
. (o
is removed from the group)public java.lang.Object waitAndGetTheNth(int n)
waitAndGetTheNth
in interface Group
n
- - the rank of the wanted member.
n
in the Group.public int waitOneAndGetIndex()
waitOneAndGetIndex
in interface Group
public boolean allAwaited()
allAwaited
in interface Group
true
if all the members of the Group are awaited.public boolean allArrived()
allArrived
in interface Group
true
if all the members of the Group are arrived.public ExceptionList getExceptionList()
getExceptionList
in interface Group
public void purgeExceptionAndNull()
purgeExceptionAndNull
in interface Group
public void setRatioMemberToThread(int i)
setRatioMemberToThread
in interface Group
i
- - the new ratiopublic void setAdditionalThread(int i)
i
- - the new numberprotected void createMemberWithMultithread(java.lang.String className, java.lang.Object[][] params, java.lang.String[] nodeList)
className
- - the name of the Class of the members.params
- - an array that contains the parameters for the constructor of member.nodeList
- - the nodes where the member will be created.protected void createMemberWithMultithread(java.lang.String className, java.lang.Object[] params, java.lang.String[] nodeList)
className
- - the name of the Class of the members.params
- - the parameters for the constructor of members.nodeList
- - the nodes where the member will be created.public void set(int index, java.lang.Object o)
index
- - the positiono
- - the object to addpublic boolean containsKey(java.lang.String key)
true
if this Group contains a mapping for the specified key.
More formally, returns true
if and only if this Group contains at
a mapping for a key k
such that (key==null ? k==null : key.equals(k))
.
(There can be at most one such mapping.)
containsKey
in interface Group
key
- - key whose presence in this Group is to be tested.
true
if this Group contains a mapping for the specified key.
java.lang.ClassCastException
- - if the key is of an inappropriate type for this Group (optional).
java.lang.NullPointerException
- - if the key is null and this Group does not not permit null keys (optional).public boolean containsValue(java.lang.Object value)
true
if this Group maps one or more keys to the specified value.
More formally, returns true
if and only if this Group contains at least
one mapping to a value v
such that (value==null ? v==null : value.equals(v))
.
containsValue
in interface Group
value
- - value whose presence in this map is to be tested.
true
if this Group maps one or more keys to the specified value.
java.lang.ClassCastException
- - if the value is of an inappropriate type for this Collection (optional).
java.lang.NullPointerException
- - if the value is null and this Group does not not permit null values (optional).public java.lang.Object getNamedElement(java.lang.String key)
null
if the Collection contains no mapping for this key.
A return value of null
does not necessarily indicate that the Collection
contains no mapping for the key; it's also possible that the Group explicitly maps the key to null.
The containsKey operation may be used to distinguish these two cases.
More formally, if this Group contains a mapping from a key k
to a value
v
such that (key==null ? k==null : key.equals(k))
,
then this method returns v
; otherwise it returns null
.
(There can be at most one such mapping.)
getNamedElement
in interface Group
key
- - key whose associated value is to be returned.
null
if the map contains no mapping for this key.
java.lang.ClassCastException
- - if the key is of an inappropriate type for this Group (optional).
java.lang.NullPointerException
- - key is null
and this Group does not not permit null keys (optional).public void addNamedElement(java.lang.String key, java.lang.Object value)
m
is said to contain a mapping for a key
k
if and only if m.containsKey(k)
would return true
.))
In that case, the old value is also removed from the group.
addNamedElement
in interface Group
key
- - key with which the specified value is to be associated.value
- - value to be associated with the specified key.
java.lang.UnsupportedOperationException
- - if the put operation is not supported by this Group.
java.lang.ClassCastException
- - if the class of the specified key or value prevents it from being stored in this Group.
java.lang.IllegalArgumentException
- - if some aspect of this key or value prevents it from being stored in this Group.
java.lang.NullPointerException
- - this map does not permit null keys or values, and the specified key or value is null
.public java.util.Set keySet()
keySet
in interface Group
public java.lang.Object removeNamedElement(java.lang.String key)
removeNamedElement
in interface Group
key
- the name of the element
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |