T - the type parameter@ThreadSafe public class BlockingMessageQueue<T> extends Object implements IMessageQueue<T>
| Constructor and Description |
|---|
BlockingMessageQueue()
Instantiates a new Blocking message queue.
|
BlockingMessageQueue(int limit)
Instantiates a new Blocking message queue.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLimit()
Gets limit.
|
T |
pull()
Pull message from the queue.
|
List<T> |
pull(List<T> l,
int maxElements)
Pull up to maxElements from queue.
|
List<T> |
pullAll(List<T> l)
Pull all current message on the queue.
|
int |
push(T content)
Push AisMessage onto the queue
|
int |
put(T content)
Push the specified element on the queue, waiting if necessary for space to become availably
|
public BlockingMessageQueue()
public BlockingMessageQueue(int limit)
limit - the limitpublic int push(T content) throws MessageQueueOverflowException
IMessageQueuepush in interface IMessageQueue<T>content - the contentMessageQueueOverflowException - when capacity limit has been reachedpublic int put(T content) throws InterruptedException
IMessageQueueput in interface IMessageQueue<T>content - the contentInterruptedException - the interrupted exceptionpublic T pull() throws InterruptedException
IMessageQueuepull in interface IMessageQueue<T>InterruptedException - the interrupted exceptionpublic List<T> pull(List<T> l, int maxElements) throws InterruptedException
IMessageQueuepull in interface IMessageQueue<T>l - list to add elements tomaxElements - the max elementsInterruptedException - the interrupted exceptionpublic List<T> pullAll(List<T> l) throws InterruptedException
IMessageQueuepullAll in interface IMessageQueue<T>l - the cInterruptedException - the interrupted exceptionpublic int getLimit()
Copyright © 2011–2019 Danish Maritime Authority. All rights reserved.