org.jboss.remoting
Class ConnectionValidator
java.lang.Object
java.util.TimerTask
org.jboss.remoting.ConnectionValidator
- All Implemented Interfaces:
- java.lang.Runnable, StoppableTimerTask
public class ConnectionValidator
- extends java.util.TimerTask
- implements StoppableTimerTask
- Author:
- Tom Elrod, Ovidiu Feodorov
Methods inherited from class java.util.TimerTask |
scheduledExecutionTime |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_PING_PERIOD
public static final long DEFAULT_PING_PERIOD
- Default ping period. Value is 2 seconds.
- See Also:
- Constant Field Values
ConnectionValidator
public ConnectionValidator(Client client)
ConnectionValidator
public ConnectionValidator(Client client,
long pingPeriod)
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 pingconfig
- - any configuration needed for server
- Returns:
- true if alive, false if not
- Throws:
java.lang.Throwable
stop
public void stop()
- Description copied from interface:
StoppableTimerTask
- stop() will be called when TimerUtil.unschedule() or when TimerUtil.destroy()
are called.
- Specified by:
stop
in interface StoppableTimerTask
run
public void run()
- The action to be performed by this timer task.
- Specified by:
run
in interface java.lang.Runnable
- Specified by:
run
in class java.util.TimerTask
cancel
public boolean cancel()
- Overrides:
cancel
in class java.util.TimerTask
addConnectionListener
public void addConnectionListener(ConnectionListener listener)
removeConnectionListener
public boolean removeConnectionListener(ConnectionListener listener)
getPingPeriod
public long getPingPeriod()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright ? 1998-2005 JBoss Inc . All Rights Reserved.