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 class
private static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private PublicationError
private final Object
private final BusRuntime
private MessagePublication.State
private final Collection
<Subscription> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MessagePublication
(BusRuntime runtime, Collection<Subscription> subscriptions, Object message, MessagePublication.State initialState) -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(Subscription subscription) void
execute()
getError()
boolean
hasError()
boolean
boolean
boolean
boolean
boolean
void
void
markError
(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:
execute
in interfaceIMessagePublication
-
isFinished
public boolean isFinished()- Specified by:
isFinished
in interfaceIMessagePublication
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceIMessagePublication
-
isScheduled
public boolean isScheduled()- Specified by:
isScheduled
in interfaceIMessagePublication
-
hasError
public boolean hasError()- Specified by:
hasError
in interfaceIMessagePublication
-
getError
- Specified by:
getError
in interfaceIMessagePublication
-
markDispatched
public void markDispatched() -
markError
-
markScheduled
-
isDeadMessage
public boolean isDeadMessage()- Specified by:
isDeadMessage
in interfaceIMessagePublication
-
isFilteredMessage
public boolean isFilteredMessage()- Specified by:
isFilteredMessage
in interfaceIMessagePublication
-
getMessage
- Specified by:
getMessage
in interfaceIMessagePublication
-