dk.netarkivet.archive.webinterface
Class BatchExecuter

java.lang.Object
  extended by java.lang.Thread
      extended by dk.netarkivet.archive.webinterface.BatchExecuter
All Implemented Interfaces:
java.lang.Runnable

public class BatchExecuter
extends java.lang.Thread

Class for execution of a batchjob in a separate thread.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BatchExecuter(FileBatchJob job, java.lang.String pattern, Replica replica)
          The constructor.
 
Method Summary
static java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getRunningBatchjobs()
          Method for retrieving the data for the running batchjobs.
 void run()
          Execution of the batchjob in its own thread (use start() instead).
 
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
 

Constructor Detail

BatchExecuter

public BatchExecuter(FileBatchJob job,
                     java.lang.String pattern,
                     Replica replica)
              throws ArgumentNotValid
The constructor.

Parameters:
job - The batchjob to execute.
pattern - The regular expression pattern.
replica - The replica where the batchjob should be executed.
Throws:
ArgumentNotValid - If any of the arguments are null.
Method Detail

run

public void run()
         throws IOFailure
Execution of the batchjob in its own thread (use start() instead).

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
Throws:
IOFailure - If an IOException is caught while writing the results.

getRunningBatchjobs

public static java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getRunningBatchjobs()
Method for retrieving the data for the running batchjobs.

Returns:
The set of entries in the map.