Class DistributionDaemon

  • All Implemented Interfaces:
    Runnable

    public class DistributionDaemon
    extends Daemon
    • Field Detail

      • logger

        private static final Logger logger
      • DEBUG

        private static final boolean DEBUG
      • distributionHandler

        private DistributionHandler distributionHandler
        Holds the distribution logic.
      • distributeQueue

        private Queue distributeQueue
      • ackQueue

        private Queue ackQueue
      • acklistTxName

        private String acklistTxName
    • Method Detail

      • isHandling

        boolean isHandling​(String id)
      • ackMessage

        void ackMessage​(String id)
      • run

        public void run()
      • shutdown

        protected void shutdown()
        Description copied from class: Daemon
        Interrupts a thread that waits for long periods. In some cases, we must use application specific tricks. For example, if a thread is waiting on a known socket, we have to close the socket to cause the thread to return immediately. Unfortunately, there really isn't any technique that works in general.
        Specified by:
        shutdown in class Daemon
      • close

        protected void close()
        Description copied from class: Daemon
        Releases any resources attached to this daemon. Be careful, its method should be called more than one time.
        Specified by:
        close in class Daemon
      • push

        public void push​(Message fullMessage)
        Be careful, the message must be completely loaded (body).
        Parameters:
        fullMessage -
        Throws:
        Exception
      • getNextAck

        public String getNextAck()
      • cleanAckList

        public void cleanAckList()
      • isEmpty

        public boolean isEmpty()
      • isUndeliverable

        private boolean isUndeliverable​(Message message)
      • isValid

        private boolean isValid​(Message message)
        Returns true if the message is valid. The message is valid if not expired.
      • incDeliveryCount

        private void incDeliveryCount​(Message message)
        Increments the message delivery count.