applicationEvent.getMuleEventContext().dispatchEvent(message, endpoint);
}
else
{
MuleSession session = new DefaultMuleSession(service, muleContext);
DefaultMuleEvent event = new DefaultMuleEvent(message, endpoint.getExchangePattern(),
session);
RequestContext.setEvent(event);
// transform if necessary
if (endpoint.getTransformers() != null)
{
message = new DefaultMuleMessage(applicationEvent.getSource(),
applicationEvent.getProperties(), muleContext);
message.applyTransformers(event, endpoint.getTransformers());
}
endpoint.process(new DefaultMuleEvent(message, endpoint.getExchangePattern(), session));
}
}
catch (Exception e1)
{
throw new ApplicationEventException("Failed to dispatch event: " + e1.getMessage(), e1);