JMMF API
pre-release v0.8

fr.umlv.jmmf.hook
Class AbstractMessage

java.lang.Object
  |
  +--fr.umlv.jmmf.hook.AbstractMessage
All Implemented Interfaces:
Message

public class AbstractMessage
extends java.lang.Object
implements Message

Abstract class that provide implementation for common properties of AdapterMessage and MultiMessage.

The property defined by this class are :
target (set/get),
result (set/get),
parameters (set/get/insert/remove).

Version:
0.6.2
Author:
Remi Forax

Constructor Summary
AbstractMessage()
           
 
Method Summary
 java.lang.Object[] getParameters()
          get parameters of the requested method.
 java.lang.Class[] getParameterTypes()
          get parameter type of the requested method.
 java.lang.Object getResult()
          return the result of the invocation call.
 java.lang.Object getTarget()
          return the target object of the message.
 void insertParameter(int index, java.lang.Object arg, java.lang.Class type)
          insert a parameter and it's type into the parameter list.
 void removeParameter(int index)
          remove a parameter.
 void setParameters(java.lang.Object[] args)
          set parameters of the requested method.
 void setParameters(java.lang.Object[] args, java.lang.Class[] types)
          set the arguments of the requested method.
 void setResult(java.lang.Object result)
          set an object as the result of the invocation call.
 void setTarget(java.lang.Object target)
          set the target object of the message.
protected  void updateInnerMessage()
          udpate inner-message informations.
protected  void updatePostMessage(java.lang.Object result)
          udpate post-message informations.
protected  void updatePreMessage(java.lang.Object[] args, java.lang.Class[] types)
          udpate pre-message informations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMessage

public AbstractMessage()
Method Detail

getTarget

public java.lang.Object getTarget()
return the target object of the message.

setTarget

public void setTarget(java.lang.Object target)
set the target object of the message.

getResult

public java.lang.Object getResult()
return the result of the invocation call.

setResult

public void setResult(java.lang.Object result)
set an object as the result of the invocation call.

getParameters

public java.lang.Object[] getParameters()
get parameters of the requested method.
Returns:
an array of object that contains parameters of the requested method, the array may be null.
See Also:
setParameters(Object[],Class[]), getParameterTypes()

getParameterTypes

public java.lang.Class[] getParameterTypes()
get parameter type of the requested method.
Returns:
an array of class that contains parameter types of the requested method, the array may be null.
See Also:
getParameters()

setParameters

public void setParameters(java.lang.Object[] args)
set parameters of the requested method. The types of the new parameters if processed by call the method @link Object.getClass() on each parameter. WARNING: with primitive type (int, boolean, etc...) the processed type is the wrapper type (Integer, Boolean, etc...) and not the real primitive type (Integer.TYPE, Boolean.TYPE, etc..). With primitive type, use instead
Parameters:
args - an array of object that contains the new parameters of the requested method.
See Also:
setParameters(Object[],Class[]), getParameters()

setParameters

public void setParameters(java.lang.Object[] args,
                          java.lang.Class[] types)
set the arguments of the requested method.
Parameters:
args - an array of object that contains the new parameters of the requested method.
types - an array of class that contains the types of the new parameters.
See Also:
getParameters(), getParameterTypes()

insertParameter

public void insertParameter(int index,
                            java.lang.Object arg,
                            java.lang.Class type)
insert a parameter and it's type into the parameter list.
Parameters:
arg - parameter value.
type - type of the parameter.
index - must be in range [0..parameters.length].

removeParameter

public void removeParameter(int index)
remove a parameter.
Parameters:
index - must be in range [0..parameters.length[.

updatePreMessage

protected void updatePreMessage(java.lang.Object[] args,
                                java.lang.Class[] types)
udpate pre-message informations.

updateInnerMessage

protected void updateInnerMessage()
udpate inner-message informations.

updatePostMessage

protected void updatePostMessage(java.lang.Object result)
udpate post-message informations.

JMMF API
pre-release v0.8

Rémi Forax 1999,2000 Université de Marne la Vallée