public Object onCall(MuleEventContext eventContext) throws Exception
{
if (refreshableBean instanceof GroovyObject)
{
GroovyObject script = (GroovyObject)refreshableBean;
MetaMethod onCall = script.getMetaClass().pickMethod("onCall", MULE_EVENT_CONTEXT);
if (onCall != null)
{
return script.invokeMethod(ON_CALL, eventContext);
}
else
{
if (StringUtils.isEmpty(methodName))
{
throw new DefaultMuleException(CoreMessages.propertiesNotSet("methodName"));
}
return script.invokeMethod(methodName, eventContext.getMessage().getPayload());
}
}
throw new Exception(new DefaultMuleException("script engine not supported"));