chrriis.dj.nativeswing.swtimpl
Class Message

java.lang.Object
  extended by chrriis.dj.nativeswing.swtimpl.Message
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CommandMessage

public class Message
extends Object
implements Serializable

The superclass of all the messages that are exchanged at the native interface.

Author:
Christopher Deckers
See Also:
Serialized Form

Constructor Summary
Message()
          Create an empty message.
 
Method Summary
 void asyncSend(boolean isTargetNativeSide)
          Send that message asynchronously.
protected  boolean isValid()
          Indicate whether the message is valid.
 Object syncSend(boolean isTargetNativeSide)
          Send that message synchronously, potentially returning a result if the message type allows that.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message()
Create an empty message.

Method Detail

asyncSend

public void asyncSend(boolean isTargetNativeSide)
Send that message asynchronously.

Parameters:
isTargetNativeSide - true if the target is the native side, false otherwise.

syncSend

public Object syncSend(boolean isTargetNativeSide)
Send that message synchronously, potentially returning a result if the message type allows that.

Parameters:
isTargetNativeSide - true if the target is the native side, false otherwise.
Returns:
the result if any.

isValid

protected boolean isValid()
Indicate whether the message is valid. This is called before interpreting it to give a chance for the message to prevent its interpretation.

Returns:
true if the message is valid and should be interpreted, false otherwise.

toString

public String toString()
Overrides:
toString in class Object