public abstract class InternalMessage extends ApplicationEvent
OmeroContext.publishEvent(ApplicationEvent)
or
OmeroContext.publishMessage(InternalMessage)
. It is currently
assumed that the Spring-configured ApplicationEventMulticaster
will
publish the InternalMessage
in the current Thread
. If a
subclass can properly handle the threaded case, it should set
threadSafe
to true.
Since the the OmeroContext.publishEvent(ApplicationEvent)
does not
allow for an exception, consumers of InternalMessage
subclasses can
throw a MessageException
which will properly handled by the
OmeroContext.publishMessage(InternalMessage)
method. (Users of
OmeroContext.publishEvent(ApplicationEvent)
will have to manually
unwrap the MessageException
.
Note: this class may or may not be useful for the client-side, but it must be
in the common/ package for use by OmeroContext
MessageException
,
OmeroContext
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected boolean |
threadSafe |
source
Constructor and Description |
---|
InternalMessage(Object source)
Sole constructor which takes the "source" of this
EventObject . |
Modifier and Type | Method and Description |
---|---|
boolean |
isThreadSafe()
Returns true if this message can safely be passed to another
Thread . |
getTimestamp
getSource, toString
public InternalMessage(Object source)
EventObject
.source
- EventObject.EventObject(Object)
public boolean isThreadSafe()
Thread
. The default ApplicationEventMulticaster
executes
in the same Thread
.
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.