RunData data = getRunData(pipelineData);
// Name of the button.
String theButton = null;
// ParameterParser.
ParameterParser pp = data.getParameters();
String button = pp.convert(BUTTON);
String key = null;
// Loop through and find the button.
for (Iterator it = pp.keySet().iterator(); it.hasNext();)
{
key = (String) it.next();
if (key.startsWith(button))
{
if (considerKey(key, pp))
{
theButton = formatString(key, pp);
break;
}
}
}
if (theButton == null)
{
throw new NoSuchMethodException(
"ActionEvent: The button was null");
}
Method method = null;
try
{
method = getClass().getMethod(theButton, methodParams);
Object[] methodArgs = new Object[] { pipelineData, context };
if (log.isDebugEnabled())
{
log.debug("Invoking " + method);
}
method.invoke(this, methodArgs);
}
catch (NoSuchMethodException nsme)
{
// Attempt to execute things the old way..
if (log.isDebugEnabled())
{
log.debug("Couldn't locate the Event ( " + theButton
+ "), running executeEvents() in "
+ super.getClass().getName());
}
super.executeEvents(pipelineData);
}
catch (InvocationTargetException ite)
{
Throwable t = ite.getTargetException();
log.error("Invokation of " + method , t);
throw ite;
}
finally
{
pp.remove(key);
}
}