|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
nl.astron.lofar.odtb.mom2otdbadapter.otdblistener.TaskExecutor
public class TaskExecutor
Execute the tasks that are in the queue
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private nl.astron.util.http.AstronHttpClient |
httpClient
|
private org.apache.commons.logging.Log |
log
|
private java.lang.String |
momUrl
|
private java.lang.String |
password
|
private Queue |
queue
|
private static int |
SLEEP_MILLISECONDS
|
private java.lang.String |
username
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
TaskExecutor(Queue queue,
java.lang.String username,
java.lang.String password,
java.lang.String authUrl,
java.lang.String momUrl)
Constructor |
Method Summary | |
---|---|
protected org.w3c.dom.Document |
convertStringToDocument(java.lang.String myXML)
Converts a xml to a document |
protected boolean |
equal(org.w3c.dom.Node node,
java.lang.String nodeName)
The equal method compares if an node has the given name |
protected java.lang.String |
getValue(org.w3c.dom.Node node)
The getValue method returns the value of an node |
protected boolean |
isSucceed(java.lang.String string)
Analyzed the mom2 output and return if the task is done |
protected boolean |
processTask(Task task)
Process task. |
void |
run()
start the taskExecutor thread |
protected void |
sleep()
If some error occured, the task executor going to sleep for a while |
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int SLEEP_MILLISECONDS
private org.apache.commons.logging.Log log
private nl.astron.util.http.AstronHttpClient httpClient
private Queue queue
private java.lang.String username
private java.lang.String password
private java.lang.String momUrl
Constructor Detail |
---|
public TaskExecutor(Queue queue, java.lang.String username, java.lang.String password, java.lang.String authUrl, java.lang.String momUrl)
queue
- Queue to retrieve tasksusername
- username of mom2password
- password of mom2authUrl
- authorization module urlmomUrl
- mom2 module urlMethod Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected boolean processTask(Task task)
task
- tass to process
protected void sleep()
protected boolean isSucceed(java.lang.String string)
string
-
protected org.w3c.dom.Document convertStringToDocument(java.lang.String myXML) throws java.lang.Exception
myXML
-
java.lang.Exception
protected boolean equal(org.w3c.dom.Node node, java.lang.String nodeName)
node
- nodeName
-
protected java.lang.String getValue(org.w3c.dom.Node node)
node
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |