org.springframework.webflow.util
Class DispatchMethodInvoker

java.lang.Object
  extended by org.springframework.webflow.util.DispatchMethodInvoker

public class DispatchMethodInvoker
extends java.lang.Object

Invoker and cache for dispatch methods that all share the same target object. The dispatch methods typically share the same form, but multiple exist per target object, and they only differ in name.

Author:
Keith Donald, Ben Hale

Nested Class Summary
static class DispatchMethodInvoker.MethodLookupException
          Thrown when a dispatch method could not be resolved.
 
Constructor Summary
DispatchMethodInvoker(java.lang.Object target, java.lang.Class[] parameterTypes)
          Creates a dispatch method invoker.
 
Method Summary
 java.lang.Class[] getParameterTypes()
          Returns the parameter types defining the argument signature of the dispatch methods.
 java.lang.Object getTarget()
          Returns the target object method calls are dispatched to.
 java.lang.Object invoke(java.lang.String methodName, java.lang.Object[] arguments)
          Dispatch a call with given arguments to named dispatcher method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DispatchMethodInvoker

public DispatchMethodInvoker(java.lang.Object target,
                             java.lang.Class[] parameterTypes)
Creates a dispatch method invoker.

Parameters:
target - the target to dispatch to
parameterTypes - the parameter types defining the argument signature of the dispatch methods
Method Detail

getTarget

public java.lang.Object getTarget()
Returns the target object method calls are dispatched to.


getParameterTypes

public java.lang.Class[] getParameterTypes()
Returns the parameter types defining the argument signature of the dispatch methods.


invoke

public java.lang.Object invoke(java.lang.String methodName,
                               java.lang.Object[] arguments)
                        throws DispatchMethodInvoker.MethodLookupException,
                               java.lang.Exception
Dispatch a call with given arguments to named dispatcher method.

Parameters:
methodName - the name of the method to invoke
arguments - the arguments to pass to the method
Returns:
the result of the method invokation
Throws:
DispatchMethodInvoker.MethodLookupException - when the method cannot be resolved
DispatchMethodInvoker.MethodLookupException - when the invoked method throws an exception
java.lang.Exception


Copyright © 2004-2007. All Rights Reserved.