List of usage examples for org.springframework.context.support AbstractApplicationContext setParent
@Override public void setParent(@Nullable ApplicationContext parent)
From source file:org.openspaces.esb.mule.pu.OpenSpacesMuleContextLoader.java
public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextRefreshedEvent) { if (!contextCreated) { contextCreated = true;/*from w w w.jav a 2 s . co m*/ try { muleContextFactory = new DefaultMuleContextFactory(); SpringXmlConfigurationBuilder muleXmlConfigurationBuilder = new SpringXmlConfigurationBuilder( location) { @Override protected ApplicationContext createApplicationContext(MuleContext muleContext, ConfigResource[] configResources) throws Exception { AbstractApplicationContext context = (AbstractApplicationContext) super.createApplicationContext( muleContext, configResources); context.setParent(applicationContext); muleApplicationContext = context; return context; } }; muleXmlConfigurationBuilder.setParentContext(this.applicationContext); muleContext = muleContextFactory.createMuleContext(muleXmlConfigurationBuilder); muleContext.start(); } catch (Exception e) { throw new RuntimeException("Failed to start mule [" + location + "]", e); } } } }