Class 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
    • 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
    • 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 by resumeDecisionDelivery() to work in pair with pauseDecisionDelivery().
      void deliverUnordered​(TOMMessage request, int regency)  
      void delivery​(Decision dec)
      Invoked by the TOM layer, to deliver a decision
      Recoverable 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DeliveryThread

        public DeliveryThread​(TOMLayer tomLayer,
                              ServiceReplica receiver,
                              Recoverable recoverer,
                              ServerViewController controller)
        Creates a new instance of DeliveryThread
        Parameters:
        tomLayer - TOM layer
        receiver - Object that receives requests from clients
    • Method Detail

      • 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 by pauseDecisionDelivery(). Internally, the current implementation of this method uses pauseDecisionDelivery().
      • 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.
      • 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 interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • deliverUnordered

        public void deliverUnordered​(TOMMessage request,
                                     int regency)
      • shutdown

        public void shutdown()