ome.util.messages
Class InternalMessage
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
ome.util.messages.InternalMessage
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- AbstractSessionMessage, AbstractStatsMessage, ChangeSecurityContextEvent, ConvertToBlitzExceptionMessage, EventLogMessage, ExpiredServantMessage, LoginAttemptMessage, MissingPyramidMessage, RegisterServantMessage, RegisterServiceCleanupMessage, ReindexMessage, ShapeChangeMessage, UnregisterServantMessage, UserGroupUpdateEvent
public abstract class InternalMessage
- extends org.springframework.context.ApplicationEvent
Message which can be published via
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
- Since:
- 3.0-Beta2
- Author:
- Josh Moore, josh at glencoesoftware.com
- See Also:
MessageException
,
OmeroContext
,
Serialized Form
Method Summary |
boolean |
isThreadSafe()
Returns true if this message can safely be passed to another
Thread . |
Methods inherited from class org.springframework.context.ApplicationEvent |
getTimestamp |
threadSafe
protected boolean threadSafe
InternalMessage
public InternalMessage(Object source)
- Sole constructor which takes the "source" of this
EventObject
.
- Parameters:
source
- - See Also:
EventObject.EventObject(Object)
isThreadSafe
public boolean isThreadSafe()
- Returns true if this message can safely be passed to another
Thread
. The default ApplicationEventMulticaster
executes
in the same Thread
.
OmeroJava Api
Version: 4.3.3-00d1137e-b2894
Copyright © 2009 The University of Dundee. All Rights Reserved.