Package org.objectweb.joram.mom.dest
Class DistributionDaemon
- java.lang.Object
-
- fr.dyade.aaa.common.Daemon
-
- org.objectweb.joram.mom.dest.DistributionDaemon
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classDistributionDaemon.ComparatorMessage(package private) classDistributionDaemon.ComparatorString
-
Field Summary
Fields Modifier and Type Field Description private StringacklistTxNameprivate QueueackQueueprivate static booleanDEBUGprivate Destinationdestprivate QueuedistributeQueueprivate DistributionHandlerdistributionHandlerHolds the distribution logic.private static Loggerlogger
-
Constructor Summary
Constructors Constructor Description DistributionDaemon(DistributionHandler distributionHandler, String destinationId, String destinationName, Destination dest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidackMessage(String id)voidcleanAckList()protected voidclose()Releases any resources attached to this daemon.StringgetNextAck()private voidincDeliveryCount(Message message)Increments the message delivery count.booleanisEmpty()(package private) booleanisHandling(String id)private booleanisUndeliverable(Message message)private booleanisValid(Message message)Returnstrueif the message is valid.voidpush(Message fullMessage)Be careful, the message must be completely loaded (body).voidrun()protected voidshutdown()Interrupts a thread that waits for long periods.-
Methods inherited from class fr.dyade.aaa.common.Daemon
finish, getName, interrupt, isCurrentThread, isRunning, setDaemon, setName, setPriority, setThreadGroup, start, stop, toString
-
-
-
-
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
-
dest
private Destination dest
-
acklistTxName
private String acklistTxName
-
-
Constructor Detail
-
DistributionDaemon
public DistributionDaemon(DistributionHandler distributionHandler, String destinationId, String destinationName, Destination dest)
-
-
Method Detail
-
isHandling
boolean isHandling(String id)
-
ackMessage
void ackMessage(String id)
-
run
public void run()
-
shutdown
protected void shutdown()
Description copied from class:DaemonInterrupts 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.
-
close
protected void close()
Description copied from class:DaemonReleases any resources attached to this daemon. Be careful, its method should be called more than one time.
-
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)
Returnstrueif the message is valid. The message is valid if not expired.
-
incDeliveryCount
private void incDeliveryCount(Message message)
Increments the message delivery count.
-
-