Package net.engio.mbassy.bus
Class MessagePublication
java.lang.Object
net.engio.mbassy.bus.MessagePublication
- All Implemented Interfaces:
IMessagePublication
A message publication is created for each asynchronous message dispatch. It reflects the state
of the corresponding message publication process, i.e. provides information whether the
publication was successfully scheduled, is currently running etc.
A message publication lives within a single thread. It is not designed in a thread-safe manner -> not eligible to
be used in multiple threads simultaneously .
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate PublicationErrorprivate final Objectprivate final BusRuntimeprivate MessagePublication.Stateprivate final Collection<Subscription> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMessagePublication(BusRuntime runtime, Collection<Subscription> subscriptions, Object message, MessagePublication.State initialState) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(Subscription subscription) voidexecute()getError()booleanhasError()booleanbooleanbooleanbooleanbooleanvoidvoidmarkError(PublicationError error)
-
Field Details
-
subscriptions
-
message
-
state
-
dispatched
private volatile boolean dispatched -
runtime
-
error
-
-
Constructor Details
-
MessagePublication
protected MessagePublication(BusRuntime runtime, Collection<Subscription> subscriptions, Object message, MessagePublication.State initialState)
-
-
Method Details
-
add
-
execute
public void execute()- Specified by:
executein interfaceIMessagePublication
-
isFinished
public boolean isFinished()- Specified by:
isFinishedin interfaceIMessagePublication
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceIMessagePublication
-
isScheduled
public boolean isScheduled()- Specified by:
isScheduledin interfaceIMessagePublication
-
hasError
public boolean hasError()- Specified by:
hasErrorin interfaceIMessagePublication
-
getError
- Specified by:
getErrorin interfaceIMessagePublication
-
markDispatched
public void markDispatched() -
markError
-
markScheduled
-
isDeadMessage
public boolean isDeadMessage()- Specified by:
isDeadMessagein interfaceIMessagePublication
-
isFilteredMessage
public boolean isFilteredMessage()- Specified by:
isFilteredMessagein interfaceIMessagePublication
-
getMessage
- Specified by:
getMessagein interfaceIMessagePublication
-