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.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 |
group_addr, local_addr, members, ping_responses, rank, timer, view| Constructor and Description |
|---|
TCPPING() |
| Modifier and Type | Method and Description |
|---|---|
void |
discoveryRequestReceived(Address sender,
java.lang.String logical_name,
java.util.Collection<PhysicalAddress> physical_addrs) |
java.lang.Object |
down(Event evt)
An event is to be sent down the stack.
|
java.lang.String |
getDynamicHostList() |
java.util.List<IpAddress> |
getInitialHosts()
Returns the list of initial hosts as configured by the user via XML.
|
java.lang.String |
getInitialHostsList() |
int |
getPortRange() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
void |
sendGetMembersRequest(java.lang.String cluster_name,
Promise promise,
boolean return_views_only) |
void |
setInitialHosts(java.util.List<IpAddress> initial_hosts) |
void |
setPortRange(int port_range) |
void |
start()
This method is called on a
Channel.connect(String). |
findAllMembers, findAllViews, findAllViewsAsString, findInitialMembers, findInitialMembers, findInitialMembersAsString, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getNumPingRequests, getTimeout, getView, handleConnect, handleDisconnect, makeView, providedUpServices, resetStats, setNumInitialMembers, setNumPingRequests, setTimeout, stop, updestroy, 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, upThreadEnabledprotected int max_dynamic_hosts
protected final BoundedList<PhysicalAddress> dynamic_hosts
public java.util.List<IpAddress> getInitialHosts()
public void setInitialHosts(java.util.List<IpAddress> initial_hosts)
public int getPortRange()
public void setPortRange(int port_range)
public java.lang.String getDynamicHostList()
public java.lang.String getInitialHostsList()
public void init()
throws java.lang.Exception
Protocolpublic void start()
throws java.lang.Exception
ProtocolChannel.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 Discoveryjava.lang.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(java.lang.String cluster_name,
Promise promise,
boolean return_views_only)
throws java.lang.Exception
sendGetMembersRequest in class Discoveryjava.lang.Exceptionpublic java.lang.Object down(Event evt)
DiscoveryPassDown. 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, java.lang.String logical_name, java.util.Collection<PhysicalAddress> physical_addrs)
discoveryRequestReceived in class DiscoveryCopyright ? 1998-2009 Bela Ban / Red Hat. All Rights Reserved.