org.jgroups.protocols
Class FILE_PING

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

public class FILE_PING
extends Discovery

Simple discovery protocol which uses a file on shared storage such as an SMB share, NFS mount or S3. The local address information, e.g. UUID and physical addresses mappings are written to the file and the content is read and added to our transport's UUID-PhysicalAddress cache.

The design is at doc/design/FILE_PING.txt

Version:
$Id: FILE_PING.java,v 1.5.2.4 2009/04/27 08:46:47 belaban Exp $
Author:
Bela Ban

Field Summary
protected  java.io.FilenameFilter filter
           
protected  java.io.File root_dir
           
 
Fields inherited from class org.jgroups.stack.Protocol
down_prot, log, props, stack, stats, up_prot
 
Constructor Summary
FILE_PING()
           
 
Method Summary
 java.lang.String getName()
           
 void init()
          Called after instance has been created (null constructor) and before protocol is started.
 void sendGetMembersRequest(Promise promise)
           
 boolean setProperties(java.util.Properties props)
          sets the properties of the PING protocol.
 
Methods inherited from class org.jgroups.protocols.Discovery
down, findInitialMembers, findInitialMembersAsString, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getNumPingRequests, getTimeout, handleConnect, handleDisconnect, localAddressSet, makeView, providedUpServices, resetStats, setNumInitialMembers, setNumPingRequests, setTimeout, start, stop, up
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getProperties, getProtocolStack, getThreadFactory, getTransport, getUpProtocol, printStats, providedDownServices, requiredDownServices, requiredUpServices, setDownProtocol, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, upThreadEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root_dir

protected java.io.File root_dir

filter

protected java.io.FilenameFilter filter
Constructor Detail

FILE_PING

public FILE_PING()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Protocol

setProperties

public boolean setProperties(java.util.Properties props)
Description copied from class: Discovery
sets the properties of the PING protocol. The following properties are available property: timeout - the timeout (ms) to wait for the initial members, default is 3000=3 secs property: num_initial_members - the minimum number of initial members for a FIND_INITAL_MBRS, default is 2

Overrides:
setProperties in class Discovery
Parameters:
props - - a property set
Returns:
returns true if all properties were parsed properly returns false if there are unrecnogized properties in the property set

init

public void init()
          throws java.lang.Exception
Description copied from class: Protocol
Called after instance has been created (null constructor) and before protocol is started. Properties are already set. Other protocols are not yet connected and events cannot yet be sent.

Overrides:
init in class Discovery
Throws:
java.lang.Exception - Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the channel constructor will throw an exception

sendGetMembersRequest

public void sendGetMembersRequest(Promise promise)
                           throws java.lang.Exception
Specified by:
sendGetMembersRequest in class Discovery
Throws:
java.lang.Exception


Copyright ? 1998-2008 Bela Ban. All Rights Reserved.