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.ApplicationEventMessage which can be published viaOmeroContext.publishEvent(ApplicationEvent)orOmeroContext.publishMessage(InternalMessage). It is currently assumed that the Spring-configuredApplicationEventMulticasterwill publish theInternalMessagein the currentThread. If a subclass can properly handle the threaded case, it should setthreadSafeto true. Since the theOmeroContext.publishEvent(ApplicationEvent)does not allow for an exception, consumers ofInternalMessagesubclasses can throw aMessageExceptionwhich 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 booleanthreadSafe
-
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 booleanisThreadSafe()Returns true if this message can safely be passed to anotherThread.
-