Skip to content

Instantly share code, notes, and snippets.

@marianogonzalez
Created January 27, 2012 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianogonzalez/1690712 to your computer and use it in GitHub Desktop.
Save marianogonzalez/1690712 to your computer and use it in GitHub Desktop.
create child context
// reference the files with the customized flows and resources
ConfigResource[2] resources = new ConfigResource[2];
resources[0] = new ConfigResource(new URL(pathToCustomFile1));
resources[1] = new ConfigResource(new URL(pathToCustomFile2));
// create a spring configuration builder
SpringXmlConfigurationBuilder springXmlConfigurationBuilder = new SpringXmlConfigurationBuilder(resources);
//reference the parent
springXmlConfigurationBuilder.setParentContext(parentMuleContext);
//create the child context
MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
List<ConfigurationBuilder> builders = new ArrayList<ConfigurationBuilder>();
builders.add(springXmlConfigurationBuilder);
MuleContextBuilder contextBuilder = new DefaultMuleContextBuilder();
MuleContext childContext = muleContextFactory.createMuleContext(builders, contextBuilder);
//start the context
childContext.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment