|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.stack.Protocol
org.jgroups.protocols.Discovery
org.jgroups.protocols.TCPGOSSIP
public class TCPGOSSIP
The TCPGOSSIP protocol layer retrieves the initial membership (used by the GMS when started by sending event FIND_INITIAL_MBRS down the stack). We do this by contacting one or more GossipRouters, which must be running at well-known addresses:ports. The responses should allow us to determine the coordinator whom we have to contact, e.g. in case we want to join the group. When we are a server (after having received the BECOME_SERVER event), we'll respond to TCPGOSSIP requests with a TCPGOSSIP response.
The FIND_INITIAL_MBRS event will eventually be answered with a FIND_INITIAL_MBRS_OK event up the stack.
Field Summary |
---|
Fields inherited from class org.jgroups.stack.Protocol |
---|
down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, up_handler, up_prot, up_queue, up_thread, up_thread_prio |
Constructor Summary | |
---|---|
TCPGOSSIP()
|
Method Summary | |
---|---|
void |
destroy()
This method is called on a Channel.close() . |
java.lang.String |
getName()
|
void |
handleConnectOK()
Called when CONNECT_OK has been received |
void |
sendGetMembersRequest()
|
boolean |
setProperties(java.util.Properties props)
sets the properties of the PING protocol. |
void |
start()
This method is called on a Channel.connect(String) . |
void |
stop()
This method is called on a Channel.disconnect() . |
Methods inherited from class org.jgroups.protocols.Discovery |
---|
down, findInitialMembers, findInitialMembersAsString, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getNumPingRequests, getTimeout, handleConnect, handleDisconnect, localAddressSet, makeView, providedUpServices, resetStats, setNumInitialMembers, setNumPingRequests, setTimeout, up |
Methods inherited from class org.jgroups.stack.Protocol |
---|
downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, init, passDown, passUp, printStats, providedDownServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TCPGOSSIP()
Method Detail |
---|
public java.lang.String getName()
getName
in class Protocol
public boolean setProperties(java.util.Properties props)
Discovery
setProperties
in class Discovery
props
- - a property set
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 flushed
stop
in class Discovery
public void destroy()
Protocol
Channel.close()
.
Does some cleanup; after the call the VM will terminate
destroy
in class Protocol
public void handleConnectOK()
Discovery
handleConnectOK
in class Discovery
public void sendGetMembersRequest()
sendGetMembersRequest
in class Discovery
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |