Package bftsmart.tom.core
Class DeliveryThread
- java.lang.Object
-
- java.lang.Thread
-
- bftsmart.tom.core.DeliveryThread
-
- All Implemented Interfaces:
java.lang.Runnable
public final class DeliveryThread extends java.lang.Thread
This class implements a thread which will deliver totally ordered requests to the application
-
-
Constructor Summary
Constructors Constructor Description DeliveryThread(TOMLayer tomLayer, ServiceReplica receiver, Recoverable recoverer, ServerViewController controller)
Creates a new instance of DeliveryThread
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
canDeliver()
This method is used to restart the decision delivery after awaiting a state.void
deliverLock()
Deprecated.This method does not always work when the replica was already delivering decisions.void
deliverUnlock()
Deprecated.Replaced byresumeDecisionDelivery()
to work in pair withpauseDecisionDelivery()
.void
deliverUnordered(TOMMessage request, int regency)
void
delivery(Decision dec)
Invoked by the TOM layer, to deliver a decisionRecoverable
getRecoverer()
void
pauseDecisionDelivery()
Pause the decision delivery.void
resumeDecisionDelivery()
void
run()
This is the code for the thread.void
shutdown()
void
update(ApplicationState state)
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
DeliveryThread
public DeliveryThread(TOMLayer tomLayer, ServiceReplica receiver, Recoverable recoverer, ServerViewController controller)
Creates a new instance of DeliveryThread- Parameters:
tomLayer
- TOM layerreceiver
- Object that receives requests from clients
-
-
Method Detail
-
getRecoverer
public Recoverable getRecoverer()
-
delivery
public void delivery(Decision dec)
Invoked by the TOM layer, to deliver a decision- Parameters:
dec
- Decision established from the consensus
-
deliverLock
@Deprecated public void deliverLock()
Deprecated.This method does not always work when the replica was already delivering decisions. This method is replaced bypauseDecisionDelivery()
. Internally, the current implementation of this method usespauseDecisionDelivery()
.
-
deliverUnlock
@Deprecated public void deliverUnlock()
Deprecated.Replaced byresumeDecisionDelivery()
to work in pair withpauseDecisionDelivery()
. Internally, the current implementation of this method callsresumeDecisionDelivery()
-
pauseDecisionDelivery
public void pauseDecisionDelivery()
Pause the decision delivery.
-
resumeDecisionDelivery
public void resumeDecisionDelivery()
-
canDeliver
public void canDeliver()
This method is used to restart the decision delivery after awaiting a state.
-
update
public void update(ApplicationState state)
-
run
public void run()
This is the code for the thread. It delivers decisions to the TOM request receiver object (which is the application)- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
deliverUnordered
public void deliverUnordered(TOMMessage request, int regency)
-
shutdown
public void shutdown()
-
-