configBuilder = (ConfigurationBuilder) ClassUtils.instanciateClass(configurationBuilder,
configurations);
}
catch (Exception e)
{
throw new ResourceAdapterInternalException(
"Failed to instanciate configurationBuilder class: " + configurationBuilder, e);
}
try
{
logger.info("Initializing Mule...");
MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
muleConfiguration.setSystemModelType(JcaModel.JCA_MODEL_TYPE);
contextBuilder.setMuleConfiguration(muleConfiguration);
muleContext = new DefaultMuleContextFactory().createMuleContext(configBuilder, contextBuilder);
// Make single shared application server instance of mule context
// available to DeployableMuleXmlContextListener to support hot
// deployment of Mule configurations in web applications.
DeployableMuleXmlContextListener.setMuleContext(muleContext);
}
catch (MuleException e)
{
logger.error(e);
throw new ResourceAdapterInternalException(
"Failed to load configurations: " + configurations, e);
}
try
{
logger.info("Starting Mule...");
muleContext.start();
}
catch (MuleException e)
{
logger.error(e);
throw new ResourceAdapterInternalException("Failed to start management context", e);
}
}
}