org.jgroups.protocols
Class TEST_PING

java.lang.Object
  extended by org.jgroups.stack.Protocol
      extended by org.jgroups.protocols.Discovery
          extended by org.jgroups.protocols.TEST_PING

public class TEST_PING
extends Discovery

This protocol allows for discovery to happen via data structures maintained in memory rather than relying on JGroup's transport. This allows for discovery to be much faster and predictable because it only relies on java method calls rather than network calls. Clearly, this protocol only works for clusters that are created in memory. NOTE: This protocol implementation requires a new JGroups release cos it relies on sendDiscoveryResponse() method being protected.

Since:
5.0
Author:
Galder Zamarre�o

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery
Discovery.PingSenderTask, Discovery.Responses
 
Field Summary
 
Fields inherited from class org.jgroups.protocols.Discovery
break_on_coord_rsp, group_addr, is_server, local_addr, max_rank, members, num_discovery_requests, num_initial_members, num_initial_srv_members, num_ping_requests, ping_responses, rank, return_entire_cache, sender, timeout, timer, view
 
Fields inherited from class org.jgroups.stack.Protocol
down_prot, ergonomics, id, log, name, stack, stats, up_prot
 
Constructor Summary
TEST_PING()
           
 
Method Summary
 boolean isDynamic()
           
protected  void sendDiscoveryResponse(Address logical_addr, java.util.List<PhysicalAddress> physical_addrs, boolean is_server, java.lang.String logical_name, Address sender)
           
 void sendGetMembersRequest(java.lang.String cluster_name, Promise promise, boolean returnViewsOnly)
           
 void start()
          This method is called on a Channel.connect(String).
 void stop()
          This method is called on a Channel.disconnect().
 java.lang.String toString()
           
 
Methods inherited from class org.jgroups.protocols.Discovery
deserialize, discoveryRequestReceived, down, findAllMembers, findAllViews, findAllViewsAsString, findInitialMembers, findInitialMembers, findInitialMembersAsString, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getNumPingRequests, getTimeout, getView, handleConnect, handleDisconnect, init, makeView, providedUpServices, resetStats, serializeWithoutView, setNumInitialMembers, setNumPingRequests, setTimeout, up
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, isErgonomics, printStats, providedDownServices, requiredDownServices, requiredUpServices, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TEST_PING

public TEST_PING()
Method Detail

isDynamic

public boolean isDynamic()
Specified by:
isDynamic in class Discovery

start

public void start()
           throws java.lang.Exception
Description copied from class: Protocol
This method is called on a 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.

Overrides:
start in class Discovery
Throws:
java.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, so Channel.connect(String) will throw an exception

stop

public void stop()
Description copied from class: Protocol
This method is called on a 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

Overrides:
stop in class Discovery

sendGetMembersRequest

public void sendGetMembersRequest(java.lang.String cluster_name,
                                  Promise promise,
                                  boolean returnViewsOnly)
                           throws java.lang.Exception
Specified by:
sendGetMembersRequest in class Discovery
Throws:
java.lang.Exception

sendDiscoveryResponse

protected void sendDiscoveryResponse(Address logical_addr,
                                     java.util.List<PhysicalAddress> physical_addrs,
                                     boolean is_server,
                                     java.lang.String logical_name,
                                     Address sender)
Overrides:
sendDiscoveryResponse in class Discovery

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.