クラス MessageGroupQueue
- 実装されたすべてのインターフェース:
IterableSE<Message<?>>
、CollectionSE<Message<?>>
、BlockingQueueSE<Message<?>>
、QueueSE<Message<?>>
public class MessageGroupQueue
extends AbstractQueueSE<Message<?>>
implements BlockingQueueSE<Message<?>>
MessageGroupStore
による BlockingQueue
SE。トランザクションのロールバックに直面した場合の確実な配信(ストアがトランザクションであると想定)、およびプロセスが停止した場合にメッセージが失われないようにする(ストアが永続的であると想定)ために使用できます。プロセスの再起動全体でキューを使用するには、同じグループ ID を指定する必要があるため、キューの単一の論理インスタンスで一意であるが識別可能である必要があります。- 導入:
- 2.0
- 作成者:
- Dave Syer, Oleg Zhurakousky, Gunnar Hillert, Gary Russell, Artem Bilan
コンストラクターの概要
コンストラクターコンストラクター説明MessageGroupQueue
(BasicMessageGroupStore messageGroupStore, ObjectSE groupId) MessageGroupQueue
(BasicMessageGroupStore messageGroupStore, ObjectSE groupId, int capacity) MessageGroupQueue
(BasicMessageGroupStore messageGroupStore, ObjectSE groupId, int capacity, LockSE storeLock) MessageGroupQueue
(BasicMessageGroupStore messageGroupStore, ObjectSE groupId, LockSE storeLock) メソッドのサマリー
修飾子と型メソッド説明protected boolean
'storeLock' は呼び出し元によって保持されているものと想定されます。そうでない場合は、IllegalMonitorStateException がスローされる可能性があります。protected Message
<?> doPoll()
'storeLock' は呼び出し元によって保持されているものと想定されます。そうでない場合は、IllegalMonitorStateException がスローされる可能性があります。int
drainTo
(CollectionSE<? super Message<?>> c) int
drainTo
(CollectionSE<? super Message<?>> collection, int maxElements) protected BasicMessageGroupStore
ストアを取得します。protected CollectionSE
<Message<?>> protected ConditionSE
空ではない状態を取得します。protected ConditionSE
完全ではない状態になります。protected LockSE
ストアロックを取得します。IteratorSE
<Message<?>> iterator()
boolean
boolean
offer
(Message<?> message, long timeout, TimeUnitSE unit) Message
<?> peek()
Message
<?> poll()
Message
<?> poll
(long timeout, TimeUnitSE unit) void
int
void
setPriority
(boolean priority) true の場合、メッセージストアが優先度をサポートしていることを確認します。int
size()
stream()
Message
<?> take()
クラス java.util.AbstractCollectionSE から継承されたメソッド
containsSE, containsAllSE, isEmpty, removeSE, removeAllSE, retainAllSE, toArray, toArraySE, toString
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSE
インターフェース java.util.concurrent.BlockingQueueSE から継承されたメソッド
addSE, containsSE, removeSE
インターフェース java.util.CollectionSE から継承されたメソッド
addAllSE, clear, containsAllSE, equalsSE, hashCode, isEmpty, parallelStream, removeAllSE, removeIfSE, retainAllSE, spliterator, toArray, toArraySE, toArraySE
インターフェース java.lang.IterableSE から継承されたメソッド
forEachSE
コンストラクターの詳細
MessageGroupQueue
MessageGroupQueue
MessageGroupQueue
public MessageGroupQueue(BasicMessageGroupStore messageGroupStore, ObjectSE groupId, LockSE storeLock) MessageGroupQueue
public MessageGroupQueue(BasicMessageGroupStore messageGroupStore, ObjectSE groupId, int capacity, LockSE storeLock)
メソッドの詳細
setPriority
public void setPriority(boolean priority) true の場合、メッセージストアが優先度をサポートしていることを確認します。false の場合メッセージストアが優先度を使用して受信時にメッセージの順序を決定する場合に警告します。- パラメーター:
priority
- 優先度が使用されると予想される場合は true。
iterator
- 次で指定:
- インターフェース
CollectionSE<Message<?>>
のiterator
- 次で指定:
- インターフェース
IterableSE<Message<?>>
のiterator
- 次で指定:
- クラス
AbstractCollectionSE<Message<?>>
のiterator
getMessageGroupStore
getStoreLock
getMessageStoreNotFull
getMessageStoreNotEmpty
size
public int size()- 次で指定:
- インターフェース
CollectionSE<Message<?>>
のsize
- 次で指定:
- クラス
AbstractCollectionSE<Message<?>>
のsize
peek
poll
- 次で指定:
- インターフェース
BlockingQueueSE<Message<?>>
のpollSE
- 例外:
InterruptedExceptionSE
poll
drainTo
- 次で指定:
- インターフェース
BlockingQueueSE<Message<?>>
のdrainToSE
drainTo
- 次で指定:
- インターフェース
BlockingQueueSE<Message<?>>
のdrainToSE
offer
offer
public boolean offer(Message<?> message, long timeout, TimeUnitSE unit) throws InterruptedExceptionSE - 次で指定:
- インターフェース
BlockingQueueSE<Message<?>>
のofferSE
- 例外:
InterruptedExceptionSE
put
- 次で指定:
- インターフェース
BlockingQueueSE<Message<?>>
のputSE
- 例外:
InterruptedExceptionSE
remainingCapacity
public int remainingCapacity()- 次で指定:
- インターフェース
BlockingQueueSE<Message<?>>
のremainingCapacity
take
- 次で指定:
- インターフェース
BlockingQueueSE<Message<?>>
のtake
- 例外:
InterruptedExceptionSE
getMessages
stream
- 次で指定:
- インターフェース
CollectionSE<Message<?>>
のstream
doPoll
'storeLock' は呼び出し元によって保持されているものと想定されます。そうでない場合は、IllegalMonitorStateException がスローされる可能性があります。- 戻り値:
- メッセージ // TODO @Nullable
doOffer
'storeLock' は呼び出し元によって保持されているものと想定されます。そうでない場合は、IllegalMonitorStateException がスローされる可能性があります。- パラメーター:
message
- 提供するメッセージ。- 戻り値:
- 提供された場合は true。