All Packages Class Hierarchy This Package Previous Next Index
Class JavaGroups.JavaStack.Protocols.GMS
java.lang.Object
|
+----JavaGroups.JavaStack.Protocol
|
+----JavaGroups.JavaStack.Protocols.GMS
- public class GMS
- extends Protocol
- implements Transport
Group Membership Service. The GMS finds the initial members, and then
manages CONNECT, DISCONNECT, VIEW_CHANGE and SUSPECT events, i.e. it manages the group membership,
joining new members, and broadcasting membership changes to all members. Only one of all GMS layers
is the coordinator and therefore in charge of broadcasting membership changes. When the
coordinator itself crashes, the remaining members elect a new coordinator to take over. The
coordinator is always the first member of the membership list (which is an ordered
sequence of member addresses, and is the same in all members).
Requires PING layer to retrieve initial membership (via IP MCAST or GOSSIP)
-
type
-
-
GMS()
-
-
Down(Event)
- An event is to be sent down the stack.
-
GetGroupAddress()
-
-
GetLocalAddress()
-
-
GetName()
-
-
GetProtocolStack()
-
-
Receive(long)
- Remove a message from the rsp_queue
-
RequiredDownServices()
- List of events that are required to be answered by some layer below
-
Send(Message)
-
Used e.g.
-
SetProperties(Properties)
- Setup the Protocol instance acording to the configuration string
-
toString()
-
-
Up(Event)
- In case of a request, forward the message to the method invoker.
type
public final int type
GMS
public GMS()
GetProtocolStack
public ProtocolStack GetProtocolStack()
GetLocalAddress
public Address GetLocalAddress()
GetGroupAddress
public String GetGroupAddress()
GetName
public String GetName()
- Overrides:
- GetName in class Protocol
Send
public void Send(Message msg) throws Exception
- Used e.g. by MethodInvoker to return a response. Tag the message with our type,
this result in our the message being caught by the corresponding GMS layer in
the other protocol stack(s).
The assumption here is that all messages sent using the
Send
method
will always only be sent to other GMSs ! If this is not the case, then the
Down
method should be used, with the
type
field set accordingly
Receive
public Object Receive(long timeout) throws Exception
- Remove a message from the rsp_queue
Up
public void Up(Event evt)
- In case of a request, forward the message to the method invoker. In case of a response,
put it on the response queue, to be retrieved by later Receive() calls.
- Overrides:
- Up in class Protocol
Down
public void Down(Event evt)
- An event is to be sent down the stack.
- Overrides:
- Down in class Protocol
RequiredDownServices
public Vector RequiredDownServices()
- List of events that are required to be answered by some layer below
- Overrides:
- RequiredDownServices in class Protocol
SetProperties
public boolean SetProperties(Properties props)
- Setup the Protocol instance acording to the configuration string
- Overrides:
- SetProperties in class Protocol
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index