Package org.jgroups.util
Class MaxOneThreadPerSender.Entry
java.lang.Object
org.jgroups.util.MaxOneThreadPerSender.Entry
- Enclosing class:
MaxOneThreadPerSender
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MessageBatchprotected final AsciiStringprotected final Lockprotected final booleanprotected longprotected longprotected booleanprotected final Addressprotected longprotected long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntry(Address sender, boolean mcast, AsciiString cluster_name) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanEither allows access to submit a task to the thread pool for delivery to the application, or queues the messageprotected booleanallowedToSubmitToThreadPool(MessageBatch msg_batch) protected booleanprotected booleanprocess(MessageBatch batch) reset()protected voidsetRunning(boolean flag) protected booleanprotected booleansubmit(MessageBatch batch) toString()protected booleanworkAvailable(MessageBatch msg_batch) Called byMaxOneThreadPerSender.BatchHandlerLoop.
-
Field Details
-
lock
-
running
protected boolean running -
mcast
protected final boolean mcast -
batch
-
sender
-
cluster_name
-
submitted_msgs
protected long submitted_msgs -
submitted_batches
protected long submitted_batches -
queued_msgs
protected long queued_msgs -
queued_batches
protected long queued_batches
-
-
Constructor Details
-
Entry
-
-
Method Details
-
reset
-
process
-
process
-
submit
-
submit
-
allowedToSubmitToThreadPool
Either allows access to submit a task to the thread pool for delivery to the application, or queues the message- Parameters:
msg- the message- Returns:
- true if the message can be submitted to the thread pool, or false (msg was queued)
-
allowedToSubmitToThreadPool
-
workAvailable
Called byMaxOneThreadPerSender.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).- Parameters:
msg_batch- the batch to which messages from this.batch should be transferred to.
-
setRunning
protected void setRunning(boolean flag) -
toString
-