{
if (e instanceof UnavailableException)
{
Message message = JcaMessages.cannotAllocateManagedInstance();
logger.error(message);
flowConstruct.getExceptionListener().handleException(new DefaultMuleException(message, e), event);
}
else if (e instanceof MessagingException)
{
logger.error("Failed to execute JCAEndPoint " + e.getMessage(), e);
flowConstruct.getExceptionListener().handleException(e, event);
}
else
{
flowConstruct.getExceptionListener().handleException(
new DefaultMuleException(CoreMessages.eventProcessingFailedFor(flowConstruct.getName()), e), event);
}
}
}