oranjestad.commons.beanutils.messaging
Class GenericMessage

java.lang.Object
  extended by oranjestad.commons.beanutils.messaging.GenericMessage
All Implemented Interfaces:
java.io.Serializable

public class GenericMessage
extends java.lang.Object
implements java.io.Serializable

Generic messages represents an invocation to a callback interface.

Messages can be manipulated however it's original information is always preserved via.

getOriginalArguments()
getOriginalMethod()
getOriginalChannel()

Since:
1.0
Author:
Bryant Harris
See Also:
Serialized Form

Constructor Summary
protected GenericMessage()
          Required for serialization
  GenericMessage(GenericMessage other)
          Copy constructor
  GenericMessage(java.lang.reflect.Method theMethod, java.lang.Object[] theArguments)
           
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.Object[] getArguments()
           
 Channel getChannel()
           
 java.lang.reflect.Method getMethod()
           
 java.lang.Object[] getOriginalArguments()
           
 Channel getOriginalChannel()
           
 java.lang.reflect.Method getOriginalMethod()
          The method associated with this message when it was created.
 int hashCode()
           
 void setArguments(java.lang.Object[] args)
          Sets the arguments associated with this message.
 void setChannel(Channel ch)
          Sets the channel this message was for.
 void setMethod(java.lang.reflect.Method theMethod)
          Sets the method associated with this message.
 void setOriginalChannel(Channel ch)
          Sets the original channel this message was on.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericMessage

protected GenericMessage()
Required for serialization

Since:
1.0

GenericMessage

public GenericMessage(java.lang.reflect.Method theMethod,
                      java.lang.Object[] theArguments)
Parameters:
theMethod - The method associated with this message.
theArguments - The arguments associated with this method.
Since:
1.3

GenericMessage

public GenericMessage(GenericMessage other)
Copy constructor

Parameters:
other - The message to copy.
Since:
1.3
Method Detail

getArguments

public java.lang.Object[] getArguments()
Returns:
The arguments of the message.
Since:
1.0

setArguments

public void setArguments(java.lang.Object[] args)
Sets the arguments associated with this message. These can be manipulated via GenericMessageTransformer.

Parameters:
args - The arguments.
Since:
1.0

getOriginalArguments

public java.lang.Object[] getOriginalArguments()
Returns:
The original arguments from when this message was created.
Since:
1.0

getMethod

public java.lang.reflect.Method getMethod()
Returns:
The method associated with this message.
Since:
1.3

setMethod

public void setMethod(java.lang.reflect.Method theMethod)
Sets the method associated with this message. This can be modified via GenericMessageTransformer.

Parameters:
theMethod - The method.
Since:
1.3

getOriginalMethod

public java.lang.reflect.Method getOriginalMethod()
The method associated with this message when it was created.

Returns:
The method.
Since:
1.3

setChannel

public void setChannel(Channel ch)
Sets the channel this message was for.

Parameters:
ch - The channel
Since:
1.3

getChannel

public Channel getChannel()
Returns:
The channel this message was issued on.
Since:
1.3

setOriginalChannel

public void setOriginalChannel(Channel ch)
Sets the original channel this message was on. Transformers are encouraged to change the channel of this message if appropriate but should always preserve the original channel.

Parameters:
ch - The channel.
Since:
1.3

getOriginalChannel

public Channel getOriginalChannel()
Returns:
The original channel this message was for. Transformers could remap a message to a different channel (although unlikely) and this field is intended to always preserve the original value.
Since:
1.3

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object


Copyright © 2008. All Rights Reserved.