ome.util.messages
Class InternalMessage

java.lang.Object
  extended by java.util.EventObject
      extended by org.springframework.context.ApplicationEvent
          extended by ome.util.messages.InternalMessage
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbstractSessionMessage, AbstractStatsMessage, ChangeSecurityContextEvent, ConvertToBlitzExceptionMessage, EventLogMessage, ExpiredServantMessage, LoginAttemptMessage, 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

Field Summary
protected  boolean threadSafe
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
InternalMessage(Object source)
          Sole constructor which takes the "source" of this EventObject.
 
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
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

threadSafe

protected boolean threadSafe
Constructor Detail

InternalMessage

public InternalMessage(Object source)
Sole constructor which takes the "source" of this EventObject.

Parameters:
source -
See Also:
EventObject.EventObject(Object)
Method Detail

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: Beta4.2.1-r8614-Beta4.2-b41

Copyright © 2009 The University of Dundee. All Rights Reserved.