Package com.wombat.mama
Class MamaQueueGroup
- java.lang.Object
-
- com.wombat.mama.MamaQueueGroup
-
public class MamaQueueGroup extends java.lang.Object
A simple class for distributing events across multiple queues in a round robin.
-
-
Constructor Summary
Constructors Constructor Description MamaQueueGroup(int numberOfQueues, MamaBridge bridge)
Create aMamaQueueGroup
with the specified number ofMamaQueue
s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Destroy the queue, this function should only be called if there are no open objects against the queue.void
destroyTimedWait(long timeout)
Destroy a queue.void
destroyWait()
Destroy a queue.MamaQueue
getNextQueue()
Return the next queue.void
startDispatch()
void
stopDispatch()
-
-
-
Constructor Detail
-
MamaQueueGroup
public MamaQueueGroup(int numberOfQueues, MamaBridge bridge)
Create aMamaQueueGroup
with the specified number ofMamaQueue
s. If the number of queues is 0,getNextQueue()
returns the default queue for the bridge.- Parameters:
numberOfQueues
- The number of queues to create.
-
-
Method Detail
-
destroy
public void destroy()
Destroy the queue, this function should only be called if there are no open objects against the queue. Use one of the other destroy functions to block until all objects have been cleaned up.- Throws:
MamaException
- will be thrown if there are open objects.
-
destroyWait
public void destroyWait()
Destroy a queue. Note that the queue can only be destroyed if all of the objects created on it, (timers, subscriptions etc), have been destroyed. This function will block until all of the objects have been destroyed and will then destroy the queue.
-
destroyTimedWait
public void destroyTimedWait(long timeout)
Destroy a queue. Note that the queue can only be destroyed if all of the objects created on it, (timers, subscriptions etc), have been destroyed. This function will block until all of the objects have been destroyed and will then destroy the queue.- Parameters:
timeout
- The time to block for in milliseconds.- Throws:
MamaException
- will be thrown if the timeout elapses.
-
getNextQueue
public MamaQueue getNextQueue()
Return the next queue. The queues are returned in a round robin.- Returns:
- The next queue.
-
stopDispatch
public void stopDispatch()
-
startDispatch
public void startDispatch()
-
-