protected class MaxOneThreadPerSender.Entry extends Object
Modifier and Type | Field and Description |
---|---|
protected MessageBatch |
batch |
protected IntFunction<MessageBatch> |
batch_creator |
protected Lock |
lock |
protected LongAdder |
queued_batches |
protected LongAdder |
queued_msgs |
protected boolean |
running |
protected LongAdder |
submitted_batches |
protected LongAdder |
submitted_msgs |
Modifier | Constructor and Description |
---|---|
protected |
Entry(IntFunction<MessageBatch> creator) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowedToSubmitToThreadPool(Message msg)
Either allows access to submit a task to the thread pool for delivery to the application, or queues the
message
|
protected boolean |
allowedToSubmitToThreadPool(MessageBatch msg_batch) |
protected void |
process(MessageBatch batch) |
protected void |
process(Message msg,
boolean loopback) |
MaxOneThreadPerSender.Entry |
reset() |
protected void |
setRunning(boolean flag) |
protected void |
submit(MessageBatch mb) |
protected void |
submit(Message msg,
boolean loopback) |
String |
toString() |
protected boolean |
workAvailable(MessageBatch msg_batch)
Called by
MaxOneThreadPerSender.BatchHandlerLoop . |
protected final Lock lock
protected boolean running
protected MessageBatch batch
protected IntFunction<MessageBatch> batch_creator
protected final LongAdder submitted_msgs
protected final LongAdder submitted_batches
protected final LongAdder queued_msgs
protected final LongAdder queued_batches
protected Entry(IntFunction<MessageBatch> creator)
public MaxOneThreadPerSender.Entry reset()
protected void process(Message msg, boolean loopback)
protected void process(MessageBatch batch)
protected void submit(Message msg, boolean loopback)
protected void submit(MessageBatch mb)
protected boolean allowedToSubmitToThreadPool(Message msg)
msg
- the messageprotected boolean allowedToSubmitToThreadPool(MessageBatch msg_batch)
protected boolean workAvailable(MessageBatch msg_batch)
MaxOneThreadPerSender.BatchHandlerLoop
. Atomically transfer messages from the entry's batch to this batch and
returns true if messages were transferred. If not, sets running to false and returns false. In the latter
case, the handler must terminate (or else, we could have multiple handler running).msg_batch
- the batch to which messages from this.batch should be transferred to.protected void setRunning(boolean flag)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.