Package ome.util.messages
Class InternalMessage
- java.lang.Object
-
- java.util.EventObject
-
- org.springframework.context.ApplicationEvent
-
- ome.util.messages.InternalMessage
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ShutdownMessage
,UserSignalMessage
public abstract class InternalMessage extends org.springframework.context.ApplicationEvent
Message which can be published viaOmeroContext.publishEvent(ApplicationEvent)
orOmeroContext.publishMessage(InternalMessage)
. It is currently assumed that the Spring-configuredApplicationEventMulticaster
will publish theInternalMessage
in the currentThread
. If a subclass can properly handle the threaded case, it should setthreadSafe
to true. Since the theOmeroContext.publishEvent(ApplicationEvent)
does not allow for an exception, consumers ofInternalMessage
subclasses can throw aMessageException
which will properly handled by theOmeroContext.publishMessage(InternalMessage)
method. (Users ofOmeroContext.publishEvent(ApplicationEvent)
will have to manually unwrap theMessageException
. Note: this class may or may not be useful for the client-side, but it must be in the common/ package for use byOmeroContext
- Since:
- 3.0-Beta2
- See Also:
MessageException
,OmeroContext
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
threadSafe
-
Constructor Summary
Constructors Constructor Description InternalMessage(java.lang.Object source)
Sole constructor which takes the "source" of thisEventObject
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isThreadSafe()
Returns true if this message can safely be passed to anotherThread
.
-