|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibis.gmi.Group
The Group
class takes care of the startup, and has methods
to create, join, lookup, and exit a group.
Field Summary | |
static org.apache.log4j.Logger |
logger
|
Constructor Summary | |
Group()
|
Method Summary | |
static void |
create(java.lang.String nm,
java.lang.Class type,
int size)
Creates a group. |
static void |
exit()
Exits from a group and cleans up resources. |
static GroupMethod |
findMethod(GroupInterface i,
java.lang.String desc)
Looks up the method described by descr in the group interface i. |
static SendPort |
getMulticastSendport(java.lang.String ID,
int[] hosts)
Gets a multicast send port using an identification to see if we already have such a send port. |
static void |
join(java.lang.String nm,
GroupMember o)
Joins the group with this name, by communicating with the group registry, and blocks until the group is ready. |
static void |
join(java.lang.String nm,
GroupMember o,
int rank)
Joins the group with this name, by communicating with the group registry, and blocks until the group is ready. |
static void |
join(java.lang.String nm,
GroupMember o,
int rank,
long timeout)
Joins the group with this name, by communicating with the group registry, and blocks until the group is ready. |
static GroupInterface |
lookup(java.lang.String nm)
Looks up the group with this name, if necessary by communicating with the group registry, and possibly waiting until the group is ready. |
static GroupInterface |
lookup(java.lang.String nm,
long timeout)
Looks up the group with this name, if necessary by communicating with the group registry, and possibly waiting until the group is ready. |
static int |
rank()
Returns the node identification of the invoker. |
static int |
size()
Returns the total number of nodes in this run. |
static SendPort |
unicast(int mem)
Returns the sendport for the specified group member. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static org.apache.log4j.Logger logger
Constructor Detail |
public Group()
Method Detail |
public static SendPort getMulticastSendport(java.lang.String ID, int[] hosts)
ID
- identification of the send porthosts
- the target hosts of the multicast
public static void create(java.lang.String nm, java.lang.Class type, int size) throws java.lang.RuntimeException
nm
- the name of the group to be createdtype
- the group interface that this group will providesize
- the number of group members that this group will have
java.lang.RuntimeException
- when the group already exists or in case
of a communication error.public static void join(java.lang.String nm, GroupMember o, int rank, long timeout) throws java.lang.RuntimeException
nm
- the name of the group we are joiningo
- the member that is joining the grouprank
- the rank that the member wishes to have in the grouptimeout
- the maximum time the operation may block (in milliseconds).
Join will block indefinitely if timeout is 0 or smaller.
java.lang.RuntimeException
- when the group is not found,
the group is already full, or something else goes wrong.public static void join(java.lang.String nm, GroupMember o) throws java.lang.RuntimeException
nm
- the name of the group we are joiningo
- the member that is joining the group
java.lang.RuntimeException
- when the group is not found,
the group is already full, or something else goes wrong.public static void join(java.lang.String nm, GroupMember o, int rank) throws java.lang.RuntimeException
nm
- the name of the group we are joiningo
- the member that is joining the grouprank
- the rank that the member wishes to have in the group
java.lang.RuntimeException
- when the group is not found,
the group is already full, or something else goes wrong.public static GroupInterface lookup(java.lang.String nm) throws java.lang.RuntimeException
nm
- the name of the group we are looking for
java.lang.RuntimeException
- some network error has occurredpublic static GroupInterface lookup(java.lang.String nm, long timeout) throws java.lang.RuntimeException
nm
- the name of the group we are looking fortimeout
- maximum time the operation may block, in milliseconds.
(0 indicates that the lookup returns immediately, negative value indicates
no timeout)
java.lang.RuntimeException
- when the group is not found, or something
else goes wrong.public static int rank()
public static int size()
public static SendPort unicast(int mem)
mem
- the group member.
public static void exit()
public static GroupMethod findMethod(GroupInterface i, java.lang.String desc) throws java.lang.NoSuchMethodException
GroupMethod
is returned.
i
- the group interface in which to lookdesc
- the method descriptor, as a string. Example format:
"int lookmeup(int[],int)"
GroupMethod
object of the method.
java.lang.NoSuchMethodException
- is thrown when the method is not found.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |