|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.TimerTask | +--br.shob.server.Pinger
A TimerTask and static utility pinger. The server calls the pinger to concurrently ping clients and take action in case they don't respond.
Field Summary | |
static int |
PING_ALL_HOSTS
Constant that indicates that all hosts should be pingged |
static int |
PING_OBSERVERS_ONLY
Constant that indicates that only inactive hosts should be pingged |
static int |
PING_OWNERS_AND_WRITERS
Constant that indicates that only active hosts should be pingged |
static int |
PING_OWNERS_ONLY
Constant that indicates that only hosts who shared at least one object should be pingged |
static int |
PING_WRITERS_ONLY
Constant that indicates that only hosts who locked at least one object should be pingged |
Constructor Summary | |
Pinger(Server server)
Creates a pinger that pings all hosts every 5 seconds |
|
Pinger(Server server,
int pingMethod)
Creates a pinger that pings by the specified pingMethod every 5 seconds |
|
Pinger(Server server,
int pingMethod,
long waitTime)
Creates a pinger that pings by the specified pingMethod every waitTime seconds |
Method Summary | |
int |
getPingMethod()
Gets the pingMethod attribute of the Pinger object |
static void |
pingAllHosts(Server server)
Description of the Method |
static void |
pingObservers(Server server)
Description of the Method |
void |
pingOnce()
Description of the Method |
static void |
pingOnce(Server server,
Set targets)
Main processing method for the Pinger object |
static void |
pingOwners(Server server)
Description of the Method |
static void |
pingWriters(Server server)
Description of the Method |
void |
run()
Main processing method for the Pinger object |
void |
scheduleTo(Timer timer)
|
void |
setPingMethod(int pingMethod)
Sets the pingMethod attribute of the Pinger object |
void |
setWaitTime(long miliseconds)
Sets the waitTime attribute of the Pinger object |
void |
stop()
Description of the Method |
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 |
public static final int PING_ALL_HOSTS
public static final int PING_OBSERVERS_ONLY
public static final int PING_OWNERS_AND_WRITERS
public static final int PING_OWNERS_ONLY
public static final int PING_WRITERS_ONLY
Constructor Detail |
public Pinger(Server server)
server
- The server that wants the pinging servicepublic Pinger(Server server, int pingMethod, long waitTime)
server
- The server that wants the pinging servicepingMethod
- one of the PING_* contants defined in this classwaitTime
- time to wait between pings, in milisecondspublic Pinger(Server server, int pingMethod)
server
- The server that wants the pinging servicepingMethod
- one of the PING_* contants defined in this classMethod Detail |
public int getPingMethod()
public static void pingAllHosts(Server server)
server
- Description of the Parameterpublic static void pingObservers(Server server)
server
- Description of the Parameterpublic void pingOnce()
public static void pingOnce(Server server, Set targets)
targets
- Description of the Parameterserver
- Description of the Parameterpublic static void pingOwners(Server server)
server
- Description of the Parameterpublic static void pingWriters(Server server)
server
- Description of the Parameterpublic void run()
run
in interface Runnable
run
in class TimerTask
public void setPingMethod(int pingMethod)
pingMethod
- The new pingMethod valuepublic void setWaitTime(long miliseconds)
miliseconds
- The new waitTime valuepublic void stop()
public void scheduleTo(Timer timer)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |