org.apache.commons.pipeline.stage
Class InvokeMethodStage

java.lang.Object
  extended by org.apache.commons.pipeline.stage.BaseStage
      extended by org.apache.commons.pipeline.stage.InvokeMethodStage
All Implemented Interfaces:
Stage

public class InvokeMethodStage
extends BaseStage

Calls a method on the processed object giving it the arguments specified at the time of object construction.

Version:
$Id: InvokeMethodStage.java 3742 2006-08-28 16:50:23Z kjn $

Field Summary
 
Fields inherited from class org.apache.commons.pipeline.stage.BaseStage
context
 
Constructor Summary
InvokeMethodStage(Method method)
          Creates a new instance of InvokeMethodStage
InvokeMethodStage(Method method, Object... arguments)
          Creates a new instance of InvokeMethodStage
InvokeMethodStage(String className, String methodName, Object... arguments)
          Creates a new instance of InvokeMethodStage from the class and method names.
 
Method Summary
 Object[] getArguments()
          Returns the objects being used to invoke this method
 Method getMethod()
          Returns the method to be accessed by processing
 void process(Object obj)
          Calls the specified method on the object being processed and exqueues the result
 
Methods inherited from class org.apache.commons.pipeline.stage.BaseStage
emit, emit, init, postprocess, preprocess, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvokeMethodStage

public InvokeMethodStage(Method method)
Creates a new instance of InvokeMethodStage


InvokeMethodStage

public InvokeMethodStage(Method method,
                         Object... arguments)
Creates a new instance of InvokeMethodStage


InvokeMethodStage

public InvokeMethodStage(String className,
                         String methodName,
                         Object... arguments)
                  throws ClassNotFoundException,
                         NoSuchMethodException
Creates a new instance of InvokeMethodStage from the class and method names.

Throws:
ClassNotFoundException
NoSuchMethodException
Method Detail

getMethod

public Method getMethod()
Returns the method to be accessed by processing

Returns:
the method

getArguments

public Object[] getArguments()
Returns the objects being used to invoke this method

Returns:
The objects being used

process

public void process(Object obj)
             throws StageException
Calls the specified method on the object being processed and exqueues the result

Specified by:
process in interface Stage
Overrides:
process in class BaseStage
Parameters:
obj - The object being processed.
Throws:
StageException - an Exception thrown by an overriding implementation should be wrapped in a StageException


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.