org.jboss.remoting
Class ConnectionValidator

java.lang.Object
  extended byjava.util.TimerTask
      extended byorg.jboss.remoting.ConnectionValidator
All Implemented Interfaces:
java.lang.Runnable

public class ConnectionValidator
extends java.util.TimerTask

Author:
Tom Elrod

Field Summary
static long DEFAULT_PING_PERIOD
          Default ping period.
protected static org.jboss.logging.Logger log
           
 
Constructor Summary
ConnectionValidator(Client client)
           
ConnectionValidator(Client client, int pingPeriod)
           
 
Method Summary
 void addConnectionListener(ConnectionListener listener)
           
static boolean checkConnection(InvokerLocator locator, java.util.Map config)
          Will make $PING$ invocation on server.
 boolean removeConnectionListener(ConnectionListener listener)
           
 void run()
          The action to be performed by this timer task.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.jboss.logging.Logger log

DEFAULT_PING_PERIOD

public static final long DEFAULT_PING_PERIOD
Default ping period. Value is 2 seconds.

See Also:
Constant Field Values
Constructor Detail

ConnectionValidator

public ConnectionValidator(Client client)

ConnectionValidator

public ConnectionValidator(Client client,
                           int pingPeriod)
Method Detail

addConnectionListener

public void addConnectionListener(ConnectionListener listener)

removeConnectionListener

public boolean removeConnectionListener(ConnectionListener listener)

run

public void run()
The action to be performed by this timer task.


checkConnection

public static boolean checkConnection(InvokerLocator locator,
                                      java.util.Map config)
                               throws java.lang.Throwable
Will make $PING$ invocation on server. If sucessful, will return true. Otherwise, will throw an exception.

Parameters:
locator - - locator for the server to ping
config - - any configuration needed for server
Returns:
true if alive, false if not
Throws:
java.lang.Throwable


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.