public class MPING extends PING implements java.lang.Runnable
The discovery is assymetric: discovery requests are broadcast via the multicast socket, and received via the multicast socket by everyone in the group. However, the discovery responses are sent back via the regular transport (e.g. TCP) to the sender (discovery request contained sender's regular address, e.g. 192.168.0.2:7800).
Discovery.DiscoveryCacheDisseminationTask
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
bind_interface_str |
always_send_physical_addr_with_discovery_request, async_discovery, async_discovery_use_separate_thread_per_request, break_on_coord_rsp, cluster_name, current_coord, discovery_rsp_expiry_time, force_sending_discovery_rsps, is_coord, is_leaving, is_server, local_addr, max_members_in_discovery_request, members, num_discovery_requests, num_initial_members, num_initial_srv_members, ping_responses, return_entire_cache, send_cache_on_join, stagger_timeout, timeout, timer, transport_supports_multicasting, use_disk_cache, view, WHITESPACE
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
MPING() |
Modifier and Type | Method and Description |
---|---|
java.net.InetAddress |
getBindAddr() |
java.net.InetAddress |
getMcastAddr() |
int |
getMcastPort() |
java.util.List<java.net.NetworkInterface> |
getReceiveInterfaces() |
java.util.List<java.net.NetworkInterface> |
getSendInterfaces() |
int |
getTTL() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isReceiveOnAllInterfaces() |
boolean |
isSendOnAllInterfaces() |
void |
run() |
protected void |
sendMcastDiscoveryRequest(Message msg) |
void |
setBindAddr(java.net.InetAddress bind_addr) |
void |
setMcastAddr(java.net.InetAddress mcast_addr) |
void |
setMcastPort(int mcast_port) |
void |
setMulticastAddress(java.lang.String addr) |
void |
setTTL(int ip_ttl) |
void |
start()
This method is called on a
Channel.connect(String) . |
void |
stop()
This method is called on a
Channel.disconnect() . |
java.lang.Object |
up(Event evt)
An event was received from the layer below.
|
findMembers, isDynamic, sendDiscoveryRequest
addDiscoveryResponseToCaches, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, down, dumpCache, findInitialMembersAsString, findMembers, forceDiscoveryResponses, forceDiscoveryResponses, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getTimeout, getView, getViewId, handleConnect, handleDisconnect, handleDiscoveryResponse, isCoord, isMergeRunning, marshal, numInitialMembers, numInitialMembers, providedUpServices, read, readPingData, resetStats, returnEntireCache, returnEntireCache, sendCacheInformation, sendDiscoveryResponse, serializeWithoutView, setForceSendingDiscoveryRsps, setNumInitialMembers, setTimeout, staggerTimeout, staggerTimeout, startCacheDissemination, timeout, timeout, useDiskCache, useDiskCache, weedOutCompletedDiscoveryResponses, write
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled, up
public java.net.InetAddress getBindAddr()
public void setBindAddr(java.net.InetAddress bind_addr)
public java.util.List<java.net.NetworkInterface> getReceiveInterfaces()
public java.util.List<java.net.NetworkInterface> getSendInterfaces()
public boolean isReceiveOnAllInterfaces()
public boolean isSendOnAllInterfaces()
public int getTTL()
public void setTTL(int ip_ttl)
public java.net.InetAddress getMcastAddr()
public void setMcastAddr(java.net.InetAddress mcast_addr)
public void setMulticastAddress(java.lang.String addr) throws java.net.UnknownHostException
java.net.UnknownHostException
public int getMcastPort()
public void setMcastPort(int mcast_port)
public java.lang.Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.public void init() throws java.lang.Exception
Protocol
public void start() throws java.lang.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
java.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 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 flushedprotected void sendMcastDiscoveryRequest(Message msg)
sendMcastDiscoveryRequest
in class PING
public void run()
run
in interface java.lang.Runnable
Copyright © 1998-2020 Red Hat. All Rights Reserved.