org.springframework.integration.store
Class MessageGroupQueue
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<Message<?>>
org.springframework.integration.store.MessageGroupQueue
- All Implemented Interfaces:
- Iterable<Message<?>>, Collection<Message<?>>, BlockingQueue<Message<?>>, Queue<Message<?>>
public class MessageGroupQueue
- extends AbstractQueue<Message<?>>
- implements BlockingQueue<Message<?>>
A BlockingQueue
that is backed by a MessageGroupStore
. Can be used to ensure guaranteed delivery in
the face of transaction rollback (assuming the store is transactional) and also to ensure messages are not lost if
the process dies (assuming the store is durable). To use the queue across process re-starts, the same group id
must be provided, so it needs to be unique but identifiable with a single logical instance of the queue.
- Since:
- 2.0
- Author:
- Dave Syer
Methods inherited from interface java.util.Collection |
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
MessageGroupQueue
public MessageGroupQueue(MessageGroupStore messageGroupStore,
Object groupId)
MessageGroupQueue
public MessageGroupQueue(MessageGroupStore messageGroupStore,
Object groupId,
int capacity)
iterator
public Iterator<Message<?>> iterator()
- Specified by:
iterator
in interface Iterable<Message<?>>
- Specified by:
iterator
in interface Collection<Message<?>>
- Specified by:
iterator
in class AbstractCollection<Message<?>>
size
public int size()
- Specified by:
size
in interface Collection<Message<?>>
- Specified by:
size
in class AbstractCollection<Message<?>>
offer
public boolean offer(Message<?> e)
- Specified by:
offer
in interface BlockingQueue<Message<?>>
- Specified by:
offer
in interface Queue<Message<?>>
peek
public Message<?> peek()
- Specified by:
peek
in interface Queue<Message<?>>
poll
public Message<?> poll()
- Specified by:
poll
in interface Queue<Message<?>>
drainTo
public int drainTo(Collection<? super Message<?>> c)
- Specified by:
drainTo
in interface BlockingQueue<Message<?>>
drainTo
public int drainTo(Collection<? super Message<?>> c,
int maxElements)
- Specified by:
drainTo
in interface BlockingQueue<Message<?>>
offer
public boolean offer(Message<?> e,
long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
offer
in interface BlockingQueue<Message<?>>
- Throws:
InterruptedException
poll
public Message<?> poll(long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
poll
in interface BlockingQueue<Message<?>>
- Throws:
InterruptedException
put
public void put(Message<?> e)
throws InterruptedException
- Specified by:
put
in interface BlockingQueue<Message<?>>
- Throws:
InterruptedException
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacity
in interface BlockingQueue<Message<?>>
take
public Message<?> take()
throws InterruptedException
- Specified by:
take
in interface BlockingQueue<Message<?>>
- Throws:
InterruptedException
Copyright © 2010. All Rights Reserved.