org.apache.tapestry.listener
Class ListenerMethodInvokerImpl

java.lang.Object
  extended by org.apache.tapestry.listener.ListenerMethodInvokerImpl
All Implemented Interfaces:
ListenerMethodInvoker

public class ListenerMethodInvokerImpl
extends Object
implements ListenerMethodInvoker

Logic for mapping a listener method name to an actual method invocation; this may require a little searching to find the correct version of the method, based on the number of parameters to the method (there's a lot of flexibility in terms of what methods may be considered a listener method).

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
ListenerMethodInvokerImpl(String name, Method[] methods)
           
 
Method Summary
 String getMethodName()
          The actual method name that this listener represents.
 void invokeListenerMethod(Object target, IRequestCycle cycle)
          Called to invoke the bound listener method.
protected  Object invokeTargetMethod(Object target, Method listenerMethod, Object[] parameters)
          Provided as a hook so that subclasses can perform any additional work before or after invoking the listener method.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListenerMethodInvokerImpl

public ListenerMethodInvokerImpl(String name,
                                 Method[] methods)
Method Detail

invokeListenerMethod

public void invokeListenerMethod(Object target,
                                 IRequestCycle cycle)
Description copied from interface: ListenerMethodInvoker
Called to invoke the bound listener method.

Specified by:
invokeListenerMethod in interface ListenerMethodInvoker
Parameters:
target - The object to call the listener method on.
cycle - The associated request.

invokeTargetMethod

protected Object invokeTargetMethod(Object target,
                                    Method listenerMethod,
                                    Object[] parameters)
                             throws IllegalAccessException,
                                    InvocationTargetException
Provided as a hook so that subclasses can perform any additional work before or after invoking the listener method.

Throws:
IllegalAccessException
InvocationTargetException

getMethodName

public String getMethodName()
Description copied from interface: ListenerMethodInvoker
The actual method name that this listener represents.

Specified by:
getMethodName in interface ListenerMethodInvoker
Returns:
The method name this listener is bound to.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.