Package de.bsvrz.pua.prot.processing
Class BasicFlowControl
- java.lang.Object
-
- de.bsvrz.pua.prot.processing.BasicFlowControl
-
- All Implemented Interfaces:
ProcessingInterface
- Direct Known Subclasses:
Processing,ProtocolReader
public abstract class BasicFlowControl extends java.lang.Object implements ProcessingInterface
Basisklasse für Protokolldaten-sendende Klassen, die eine Flusskontrolle unterstützen. Bei jedem erfolgreich versendeten Datensatz mussdatasetSend()aufgerufen werden um den Zähler der gesendeten Daten hochzuzählen.flowControl()kann immer aufgerufen werden bevor ein Datensätze versendet werden würde um den Versand ggf. auszubremsen.
-
-
Constructor Summary
Constructors Constructor Description BasicFlowControl(long maxDelay, int timeout, long initialFlowControl)Erzeut eine neue Instanz
-
Method Summary
Modifier and Type Method Description voiddatasetSend()protected voidflowControl()Flußkontrolle.voidflowControl(long numData)Clientseitige automatische flusskontrolle.protected abstract java.lang.ObjectgetClient()abstract longgetJobId()Gibt die Auftrags-Id zurückintgetTimeout()voidpauseProcessing()Versand von Protokolldatensätzen anhalten.voidresumeProcessing()Versand von Protokolldatensätzen fortsetzen.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.bsvrz.pua.prot.processing.ProcessingInterface
abort, getJobState, getProtocolId, getStatus, process, stopProtocolTransmission
-
-
-
-
Constructor Detail
-
BasicFlowControl
public BasicFlowControl(long maxDelay, int timeout, long initialFlowControl)Erzeut eine neue Instanz- Parameters:
maxDelay- Maximale wartezeit bei manueller Flusskontrolle in mstimeout- Anzahl Minuten ohne Antwort vom Client, nach der die Übertragung getrennt wirdinitialFlowControl- Anzahl initial zu sendende Datensätze bis zu automatische Flusskontrolle den Versand bremst
-
-
Method Detail
-
pauseProcessing
public void pauseProcessing()
Description copied from interface:ProcessingInterfaceVersand von Protokolldatensätzen anhalten.- Specified by:
pauseProcessingin interfaceProcessingInterface- See Also:
ProcessingInterface.pauseProcessing()
-
resumeProcessing
public void resumeProcessing()
Description copied from interface:ProcessingInterfaceVersand von Protokolldatensätzen fortsetzen.- Specified by:
resumeProcessingin interfaceProcessingInterface- See Also:
ProcessingInterface.resumeProcessing()
-
flowControl
protected void flowControl() throws java.lang.InterruptedExceptionFlußkontrolle. Ggf. wird wird gewartet bis das Senden fortgesetzt werden kann.- Throws:
java.lang.InterruptedException- Warten wurde unterbrochen.
-
getClient
protected abstract java.lang.Object getClient()
-
getJobId
public abstract long getJobId()
Description copied from interface:ProcessingInterfaceGibt die Auftrags-Id zurück- Specified by:
getJobIdin interfaceProcessingInterface- Returns:
- Id des Auftrags
-
flowControl
public void flowControl(long numData)
Description copied from interface:ProcessingInterfaceClientseitige automatische flusskontrolle. Der Client gibt vor, bis zu welchem Datensatz PuA Datensätze mit voller Geschwindigkeit senden soll. danach wird der Versand stark ausgebremst (nicht völlig gestoppt, da PuA sonst evtl. nicht merkt, ob der Client noch erreichbar ist)- Specified by:
flowControlin interfaceProcessingInterface- Parameters:
numData- Bis zu welcher Datensatznummer (einfach durchnummeriert) Daten gesendet werden sollen.
-
datasetSend
public void datasetSend()
-
getTimeout
public int getTimeout()
-
-