org.jcreme.sql
Class CremeAction

java.lang.Object
  extended byorg.jcreme.sql.CremeAction

public class CremeAction
extends java.lang.Object

This class enables to store a method call on an object. In particular it can be used to store a call that is to be performed in a part that has no other access to the subject object and has no knowledge (at compile time) of the method to call.


Constructor Summary
CremeAction(java.lang.reflect.Method method)
          Creates a new CremeAction
 
Method Summary
 java.lang.Object getResult()
          Gives access to the result of the previous invocation.
 boolean isSuccessfull()
          Gives access to the status of the previous invocation.
 boolean runAction()
          This method makes the call of the method on the current subject with the current parameters.
 void setParameters(java.lang.Object[] params)
          Enables to set the parameters of the method call.
 void setSubject(java.lang.Object obj)
          Enables to set the subject of the method call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CremeAction

public CremeAction(java.lang.reflect.Method method)
            throws java.lang.IllegalArgumentException
Creates a new CremeAction

Parameters:
method - the method that will be called from this CremeAction.
Throws:
java.lang.IllegalArgumentException - if the method parameter is null.
Method Detail

setSubject

public void setSubject(java.lang.Object obj)
Enables to set the subject of the method call.

Parameters:
obj - the subject of the call.

setParameters

public void setParameters(java.lang.Object[] params)
Enables to set the parameters of the method call.

Parameters:
params - the parameters of the call.

runAction

public boolean runAction()
                  throws java.lang.reflect.InvocationTargetException
This method makes the call of the method on the current subject with the current parameters.

Returns:
true if the invocation was successfull, false otherwise.
Throws:
java.lang.reflect.InvocationTargetException - if the current subject is not valid for this call.

getResult

public java.lang.Object getResult()
Gives access to the result of the previous invocation.

Returns:
the result of the previous invocation.

isSuccessfull

public boolean isSuccessfull()
Gives access to the status of the previous invocation.

Returns:
true if the previous invocation was successfull, false otherwise.


Copyright 2006 null. All Rights Reserved.