org.apache.commons.workflow.core
Class InvokeStep

java.lang.Object
  extended byorg.apache.commons.workflow.base.BaseStep
      extended byorg.apache.commons.workflow.base.DescriptorStep
          extended byorg.apache.commons.workflow.core.InvokeStep
All Implemented Interfaces:
org.apache.commons.workflow.Descriptors, org.apache.commons.workflow.Step

public class InvokeStep
extends DescriptorStep

Call the specified method of the specified bean in the specified scope, passing arguments as specified by associated Descriptor objects. The first associated Descriptor identifies the Java object on whom method invocation shall take place.

FIXME - Better way to deal with exceptions???

Supported Attributes:

Version:
$Revision: 1.6 $ $Date: 2004/07/28 03:49:24 $

Field Summary
protected  java.lang.String method
          The method name to be invoked.
 
Fields inherited from class org.apache.commons.workflow.base.DescriptorStep
descriptors
 
Fields inherited from class org.apache.commons.workflow.base.BaseStep
id, nextStep, owner, previousStep
 
Constructor Summary
InvokeStep()
          Construct a default instance of this Step.
InvokeStep(java.lang.String id)
          Construct an instance of this Step with the specified identifier.
InvokeStep(java.lang.String id, java.lang.String method)
          Construct a fully configured instance of this Step.
InvokeStep(java.lang.String id, java.lang.String method, org.apache.commons.workflow.Descriptor descriptor)
          Construct a fully configured instance of this Step.
 
Method Summary
 void execute(org.apache.commons.workflow.Context context)
          Perform the executable actions related to this Step, in the context of the specified Context.
protected  java.lang.reflect.Method findMethod(java.lang.Object bean, java.lang.String name, java.lang.Class[] types)
          Return a Method of the specified Class with the specified method name, that takes the specified parameter types, if there is one.
 java.lang.String getMethod()
           
 void setMethod(java.lang.String method)
           
protected  java.lang.String signature(java.lang.String name, java.lang.Class[] types)
          Return a method signature useful in debugging and exception messages.
 java.lang.String toString()
          Render a string representation of this Step.
 
Methods inherited from class org.apache.commons.workflow.base.DescriptorStep
addDescriptor, findDescriptors, removeDescriptor
 
Methods inherited from class org.apache.commons.workflow.base.BaseStep
getId, getNextStep, getOwner, getPreviousStep, setId, setNextStep, setOwner, setPreviousStep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

method

protected java.lang.String method
The method name to be invoked.

Constructor Detail

InvokeStep

public InvokeStep()
Construct a default instance of this Step.


InvokeStep

public InvokeStep(java.lang.String id)
Construct an instance of this Step with the specified identifier.

Parameters:
id - Step identifier

InvokeStep

public InvokeStep(java.lang.String id,
                  java.lang.String method)
Construct a fully configured instance of this Step.

Parameters:
id - Step identifier
method - Method name

InvokeStep

public InvokeStep(java.lang.String id,
                  java.lang.String method,
                  org.apache.commons.workflow.Descriptor descriptor)
Construct a fully configured instance of this Step.

Parameters:
id - Step identifier
method - Method name
descriptor - Descriptor for the bean on which to invoke
Method Detail

getMethod

public java.lang.String getMethod()

setMethod

public void setMethod(java.lang.String method)

execute

public void execute(org.apache.commons.workflow.Context context)
             throws org.apache.commons.workflow.StepException
Perform the executable actions related to this Step, in the context of the specified Context.

Specified by:
execute in interface org.apache.commons.workflow.Step
Specified by:
execute in class BaseStep
Parameters:
context - The Context that is tracking our execution state
Throws:
org.apache.commons.workflow.StepException - if a processing error has occurred

toString

public java.lang.String toString()
Render a string representation of this Step.


findMethod

protected java.lang.reflect.Method findMethod(java.lang.Object bean,
                                              java.lang.String name,
                                              java.lang.Class[] types)
Return a Method of the specified Class with the specified method name, that takes the specified parameter types, if there is one. Otherwise, return null.

Parameters:
bean - Bean on which method searching is to be done
name - Method name to search for
types - Parameter types to search for

signature

protected java.lang.String signature(java.lang.String name,
                                     java.lang.Class[] types)
Return a method signature useful in debugging and exception messages.

Parameters:
name - Method name
types - Parameter types


Copyright © 2001-2005 The Apache Software Foundation. All Rights Reserved.