public class ThreadElement
extends java.lang.Thread
Modifier and Type | Class and Description |
---|---|
static class |
ThreadElement.Operation |
Modifier and Type | Field and Description |
---|---|
static byte |
INVALID_STATUS
Status der Protokollerstellung nicht ermittelbar.
|
boolean |
running
Zeigt an, ob der Thread bereits läuft, d.h. ob er sich bereits in die
run Methode befindet. |
Constructor and Description |
---|
ThreadElement(ThreadPool creator,
DataManagerInterface dataManager,
long maxDelay,
int timeout)
Initialisierung des Objekts
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Bricht die Protokollerstellung ab.
|
void |
activateCreateProtocol(ClientDavInterface dav,
SystemObject client,
long requestId,
ProcessingParameter pp,
long protocolId,
long jobId,
long startTime,
long initialFlowControl)
Startet die Protokollerstellung.
|
void |
activateGetProtocol(ClientDavInterface dav,
SystemObject client,
long requestId,
long protocolId,
long jobId,
long startTime,
long initialFlowControl)
Startet das Senden eines bereits gespeicherten Protokolls.
|
void |
activateGetUnreadProtocol(ClientDavInterface dav,
SystemObject client,
long requestId,
long protocolId,
long jobId,
long startTime,
long initialFlowControl)
Startet das Senden eines noch nicht abgerufenen Protokolls.
|
protected ProcessingInformation |
evaluateScript()
Evaluiert das Skript.
|
void |
flowControl(long numData) |
long |
getJobId()
Gibt die eindeutige ID dieses Auftrags zurück.
|
ThreadElement.Operation |
getOperation()
Gibt die aktuell durchgeführte Aktion zurück
|
long |
getProtocolId()
Liefert die Protokoll-Id.
|
long |
getRequestId() |
byte |
getStatus()
Liefert den Status des Auftrags
|
void |
kill()
Bricht den Auftrag ab und beendet den Thread vollständig.
|
void |
pauseProcessing()
Flußsteuerung: Versand des Protokolls anhalten.
|
void |
resumeProcessing()
Flußsteuerung: Versand des Protokolls fortsetzen.
|
void |
run()
Startet den Thread und versetzt ihn sofort in einen Schlafzustand, aus dem er erst wieder geweckt wird, wenn eine Anfrage eingeht.
|
void |
stopProtocolTransmission() |
JobInProgress |
toJobInProgress()
Erstellt ein JobInProgress-Objekt zur Übertragung des Auftragsstatus an den Client
|
activeCount, checkAccess, clone, 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
public static final byte INVALID_STATUS
public boolean running
run
Methode befindet.public ThreadElement(ThreadPool creator, DataManagerInterface dataManager, long maxDelay, int timeout) throws FailureException
creator
- Erzeuger des Threads. Wird benachrichtigt (@link ThreadPool#finished(ThreadElement)}), sobald Thread unbeschäftigt ist.dataManager
- Data Manager. Ermöglicht das Interpretieren des SkriptsmaxDelay
- Maximale Zeitdauer in ms, für die die Protokollerstellung angehalten werden kann.timeout
- FailureException
- Fehler bei der Initialisierung.public byte getStatus()
INVALID_STATUS
falls kein Auftrag anliegt.protected ProcessingInformation evaluateScript() throws FailureException
DataManagerInterface
) der Skriptinterpreter (Interpreter
) verwendet.FailureException
- Fehler im Skript.public void abort()
_creator
, dass er wieder für neue Anfragen zur Verfügung steht. Dazu ruft er die Methode
ThreadPool.finished(ThreadElement)
auf. Wird das Protokoll gespeichert auf dem Datenträger gespeichert, wird es wieder gelöscht. Im Gegensatz zu
kill()
steht der Thread danach weiterhin zur Verfügung.public void stopProtocolTransmission()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void activateCreateProtocol(ClientDavInterface dav, SystemObject client, long requestId, ProcessingParameter pp, long protocolId, long jobId, long startTime, long initialFlowControl) throws FailureException
dav
- Verbindung zum Datenverteilerclient
- AuftraggeberrequestId
- Anfrage-IDpp
- Auftragsparameter.protocolId
- Protokoll-IdjobId
- startTime
- initialFlowControl
- FailureException
- Fehler bei der Sendeanmeldung.public void activateGetProtocol(ClientDavInterface dav, SystemObject client, long requestId, long protocolId, long jobId, long startTime, long initialFlowControl) throws FailureException
dav
- Verbindung zum Datenverteiler.client
- Auftraggeber.requestId
- Anfrage-IDprotocolId
- Id des Protokolls, das gesendet werden soll.jobId
- startTime
- initialFlowControl
- FailureException
- Fehler bei der Sendeanmeldung.public void activateGetUnreadProtocol(ClientDavInterface dav, SystemObject client, long requestId, long protocolId, long jobId, long startTime, long initialFlowControl) throws FailureException
dav
- Verbindung zum Datenverteiler.client
- Auftraggeber.requestId
- Anfrage-IDprotocolId
- Id des Protokolls, das gesendet werden soll.jobId
- startTime
- initialFlowControl
- FailureException
- Fehler bei der Sendeanmeldung.public void kill()
public long getProtocolId()
public long getJobId()
public void pauseProcessing()
public void resumeProcessing()
public void flowControl(long numData)
public long getRequestId()
public ThreadElement.Operation getOperation()
public JobInProgress toJobInProgress() throws FailureException
FailureException