org.jgroups.protocols
public abstract class Discovery extends Protocol
The FIND_INITIAL_MBRS event will eventually be answered with a FIND_INITIAL_MBRS_OK event up the stack. The following properties are available
Version: $Id: Discovery.java,v 1.14 2005/12/16 16:02:43 belaban Exp $
Method Summary | |
---|---|
void | down(Event evt)
An event is to be sent down the stack. |
Vector | findInitialMembers()
Finds the initial membership |
String | findInitialMembersAsString() |
int | getNumberOfDiscoveryRequestsSent() |
int | getNumInitialMembers() |
int | getNumPingRequests() |
long | getTimeout() |
void | handleConnect() |
void | handleConnectOK() Called when CONNECT_OK has been received |
void | handleDisconnect() |
void | localAddressSet(Address addr) Called after local_addr was set |
protected View | makeView(Vector mbrs) |
Vector | providedUpServices() |
void | resetStats() |
abstract void | sendGetMembersRequest() |
void | setNumInitialMembers(int num_initial_members) |
void | setNumPingRequests(int num_ping_requests) |
boolean | setProperties(Properties props)
sets the properties of the PING protocol.
|
void | setTimeout(long timeout) |
void | start() |
void | stop() |
void | up(Event evt)
An event was received from the layer below. |
PassDown
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using passUp()
.
The PING protocol is interested in several different down events,
Event.FIND_INITIAL_MBRS - sent by the GMS layer and expecting a GET_MBRS_OK
Event.TMP_VIEW and Event.VIEW_CHANGE - a view change event
Event.BECOME_SERVER - called after client has joined and is fully working group member
Event.CONNECT, Event.DISCONNECT.Returns: Vector
Parameters: props - a property set
Returns: returns true if all properties were parsed properly returns false if there are unrecnogized properties in the property set
PassDown
or c) the event (or another event) is sent up
the stack using PassUp
.
For the PING protocol, the Up operation does the following things.
1. If the event is a Event.MSG then PING will inspect the message header.
If the header is null, PING simply passes up the event
If the header is PingHeader.GET_MBRS_REQ then the PING protocol
will PassDown a PingRequest message
If the header is PingHeader.GET_MBRS_RSP we will add the message to the initial members
vector and wake up any waiting threads.
2. If the event is Event.SET_LOCAL_ADDR we will simple set the local address of this protocol
3. For all other messages we simple pass it up to the protocol above
Parameters: evt - the event that has been sent from the layer below