public class TCPPING extends Discovery
The FIND_INITIAL_MBRS event will eventually be answered with a FIND_INITIAL_MBRS_OK event up the stack.
The TCPPING protocol requires a static configuration, which assumes that you to know in advance where to find other members of your group. For dynamic discovery, use the PING protocol, which uses multicast discovery, or the TCPGOSSIP protocol, which contacts a Gossip Router to acquire the initial membership.
Discovery.PingSenderTask, Discovery.Responses
Modifier and Type | Field and Description |
---|---|
protected BoundedList<PhysicalAddress> |
dynamic_hosts
https://jira.jboss.org/jira/browse/JGRP-989
|
protected int |
max_dynamic_hosts |
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 |
---|
TCPPING() |
Modifier and Type | Method and Description |
---|---|
void |
clearDynamicHostList() |
void |
discoveryRequestReceived(Address sender,
String logical_name,
Collection<PhysicalAddress> physical_addrs) |
Object |
down(Event evt)
An event is to be sent down the stack.
|
String |
getDynamicHostList() |
List<IpAddress> |
getInitialHosts()
Returns the list of initial hosts as configured by the user via XML.
|
String |
getInitialHostsList() |
int |
getPortRange() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isDynamic() |
void |
sendGetMembersRequest(String cluster_name,
Promise promise,
ViewId view_id) |
void |
setInitialHosts(List<IpAddress> initial_hosts) |
void |
setPortRange(int port_range) |
void |
start()
This method is called on a
Channel.connect(String) . |
deserialize, findAllViews, findAllViewsAsString, findInitialMembers, findInitialMembersAsString, findMembers, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getNumPingRequests, getTimeout, getView, getViewId, handleConnect, handleDisconnect, makeView, providedUpServices, resetStats, sendDiscoveryResponse, serializeWithoutView, setNumInitialMembers, setNumPingRequests, setTimeout, stop, up
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
protected int max_dynamic_hosts
protected final BoundedList<PhysicalAddress> dynamic_hosts
public List<IpAddress> getInitialHosts()
public int getPortRange()
public void setPortRange(int port_range)
public String getDynamicHostList()
public void clearDynamicHostList()
public String getInitialHostsList()
public void init() throws Exception
Protocol
public void start() throws Exception
Protocol
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.start
in class Discovery
Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String)
will throw an exceptionpublic void sendGetMembersRequest(String cluster_name, Promise promise, ViewId view_id) throws Exception
sendGetMembersRequest
in class Discovery
Exception
public Object down(Event evt)
Discovery
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 up_prot.up()
.
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.public void discoveryRequestReceived(Address sender, String logical_name, Collection<PhysicalAddress> physical_addrs)
discoveryRequestReceived
in class Discovery
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.