public class FILE_PING extends Discovery
Modifier and Type | Class and Description |
---|---|
protected class |
FILE_PING.WriterTask |
Discovery.Responses
Modifier and Type | Field and Description |
---|---|
protected FilenameFilter |
filter |
protected long |
interval |
protected String |
location |
protected File |
root_dir |
protected static String |
SUFFIX |
break_on_coord_rsp, current_coord, force_sending_discovery_rsps, group_addr, is_coord, is_leaving, is_server, local_addr, members, num_discovery_requests, num_initial_members, num_initial_srv_members, ping_responses, return_entire_cache, stagger_timeout, timeout, timer, view
Constructor and Description |
---|
FILE_PING() |
Modifier and Type | Method and Description |
---|---|
protected static String |
addressAsString(Address address) |
protected void |
createRootDir() |
Object |
down(Event evt)
An event is to be sent down the stack.
|
Collection<PhysicalAddress> |
fetchClusterMembers(String cluster_name)
Grab all current cluster members
|
protected void |
handleView(View view) |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isDynamic() |
protected List<PingData> |
readAll(String clustername)
Reads all information from the given directory under clustername
|
protected static PingData |
readFile(File file) |
protected void |
remove(String clustername,
Address addr) |
boolean |
sendDiscoveryRequestsInParallel()
Whether or not to send each discovery request on a separate (timer) thread.
|
void |
start()
This method is called on a
Channel.connect(String) . |
void |
stop()
This method is called on a
Channel.disconnect() . |
protected void |
writeToFile(PingData data,
String clustername) |
deserialize, discoveryRequestReceived, findAllViews, findAllViewsAsString, findInitialMembers, findInitialMembersAsString, findMembers, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getTimeout, getView, getViewId, handleConnect, handleDisconnect, isMergeRunning, providedUpServices, resetStats, sendDiscoveryRequest, sendDiscoveryResponse, sendMcastDiscoveryRequest, serializeWithoutView, setForceSendingDiscoveryRsps, setNumInitialMembers, setTimeout, up
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, isErgonomics, printStats, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled
protected static final String SUFFIX
protected String location
protected long interval
protected File root_dir
protected FilenameFilter filter
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 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 Collection<PhysicalAddress> fetchClusterMembers(String cluster_name)
Discovery
fetchClusterMembers
in class Discovery
public boolean sendDiscoveryRequestsInParallel()
Discovery
Discovery.fetchClusterMembers(String)
sequentiallysendDiscoveryRequestsInParallel
in class Discovery
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.protected void createRootDir()
protected void handleView(View view)
protected List<PingData> readAll(String clustername)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.