throw new LoaderException("Null system SCDL URL");
}
XMLInputFactory xmlFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory", systemClassLoader);
Bootstrapper bootstrapper = new DefaultBootstrapper(monitor, xmlFactory);
Deployer bootDeployer = bootstrapper.createDeployer();
// create and start the core runtime
runtime = bootstrapper.createRuntime();
runtime.start(); // REVIEW: is this redundant w/ the composite.start() call below?
// initialize the runtime info
CompositeComponent parent = runtime.getSystemComponent();
RuntimeInfo runtimeInfo = new LauncherRuntimeInfo(getInstallDirectory(), getApplicationRootDirectory(), true);
parent.registerJavaObject("RuntimeInfo", RuntimeInfo.class, runtimeInfo);
// registory the monitor factory
parent.registerJavaObject("MonitorFactory", MonitorFactory.class, monitor);
// create a ComponentDefinition to represent the component we are going to deploy
SystemCompositeImplementation moduleImplementation = new SystemCompositeImplementation();
moduleImplementation.setScdlLocation(systemScdl);
moduleImplementation.setClassLoader(systemClassLoader);
ComponentDefinition<SystemCompositeImplementation> definition =
new ComponentDefinition<SystemCompositeImplementation>(
ComponentNames.TUSCANY_SYSTEM, moduleImplementation);
// deploy the component into the runtime under the system parent
composite = (CompositeComponent) bootDeployer.deploy(parent, definition);
// start the system
composite.start();
deployer = (Deployer) composite.getSystemChild("deployer").getServiceInstance();