|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.activemath.util.checks.MailingChecker
public class MailingChecker
Checker watchdog. Calls specified checks and sends mail(s) if they are failing. Main tasks:
Preconditions:
this class expects a configuration variable MailingChecker.updateInterval set to retrieve from the configuration Manager, which indicates how much time should go by between tests in seconds. If it is missing or zero, a standard value of 600 is assumed. starting up is done via the script "activemath/bin/amMailingChecker start" shutdown is done via "activeMath/bin/amMailingChecker stop". You can also check the Checker's conditions via "activeMath/bin/amMailingChecker status". Note that on any operation, the Checker's main method first checks whether the calling user has read access to the checker's session ID file, before it allows status/stop operations.
XMLRPC-invoked calls don't, but they are restricted to the machine the checker is running on, criticl methods, such as "stop" require the session key to be presented.
The session key is (for future ;-) made of 4 32-bit randomly selected integers, but it is not really secure:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
MailingChecker(Subconfiguration config)
Constructor starting the thread |
|
| Method Summary | |
|---|---|
protected void |
finalize()
|
String |
getStateUpdate()
get status as a string |
static void |
main(String[] args)
handlest startup and shutdown of the MailingChecker using XMLRPC. |
void |
run()
runs the tests. |
String |
shutDown(String sessionKey)
initiates a friendly shutdown, i.E. sets the aborted variable to false and
causes an interrupt. |
protected void |
writeStateUpdate(PrintWriter writer)
writes a status update to a Writer |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MailingChecker(Subconfiguration config)
| Method Detail |
|---|
protected void finalize()
finalize in class Objectpublic String shutDown(String sessionKey)
aborted variable to false and
causes an interrupt. This method is intended to be called via XMLRPC.
sessionKey - String which is compared to this.sessionKey. Only if they are
equal, a shutdown is really accomplished
public void run()
aborted is pulled down, shut all checks down.
run in interface Runnablerun in class Threadprotected void writeStateUpdate(PrintWriter writer)
writer - PrintWriter to which the status is to be writtenpublic String getStateUpdate()
public static void main(String[] args)
args - command-line arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||