public class PING extends Discovery
Discovery.PingSenderTask, Discovery.Responses
Modifier and Type | Field and Description |
---|---|
protected Promise<Boolean> |
discovery_reception |
break_on_coord_rsp, group_addr, is_server, local_addr, max_found_members, max_rank, members, num_discovery_requests, num_initial_members, num_initial_srv_members, num_ping_requests, ping_responses, rank, return_entire_cache, sender, stagger_timeout, timeout, timer, view
Constructor and Description |
---|
PING() |
Modifier and Type | Method and Description |
---|---|
boolean |
isDynamic() |
void |
sendGetMembersRequest(String cluster_name,
Promise promise,
ViewId view_id) |
void |
stop()
This method is called on a
Channel.disconnect() . |
Object |
up(Event evt)
An event was received from the layer below.
|
protected void |
waitForDiscoveryRequestReception() |
deserialize, discoveryRequestReceived, down, findAllViews, findAllViewsAsString, findInitialMembers, findInitialMembersAsString, findMembers, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getNumPingRequests, getTimeout, getView, getViewId, handleConnect, handleDisconnect, init, makeView, providedUpServices, resetStats, sendDiscoveryResponse, serializeWithoutView, setNumInitialMembers, setNumPingRequests, setTimeout, start
destroy, downThreadEnabled, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProperties, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, isErgonomics, printStats, providedDownServices, requiredDownServices, requiredUpServices, setDownProtocol, setErgonomics, setId, setLevel, setProperties, setPropertiesInternal, setProperty, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled, upThreadEnabled
public void stop()
Protocol
Channel.disconnect()
. Stops work (e.g. by closing multicast socket).
Will be called from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushedpublic void sendGetMembersRequest(String cluster_name, Promise promise, ViewId view_id) throws Exception
sendGetMembersRequest
in class Discovery
Exception
public Object up(Event evt)
Discovery
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 aboveprotected void waitForDiscoveryRequestReception()
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.