ContextFactoryBuilderRegistry builderRegistry = BootstrapHelper.bootstrapContextFactoryBuilders(monitorFactory);
DefaultWireBuilder wireBuilder = new DefaultWireBuilder();
RuntimeContext runtime = new RuntimeContextImpl(monitorFactory, builderRegistry, wireBuilder);
runtime.start();
runtime.getSystemContext().registerModelObject(createSystemCompositeComponent(SYSTEM_CHILD));
SystemCompositeContext ctx = (SystemCompositeContext) runtime.getSystemContext().getContext(SYSTEM_CHILD);
Component comp = systemFactory.createSystemComponent(POLICY_BUILDER_REGISTRY, PolicyBuilderRegistry.class, DefaultPolicyBuilderRegistry.class, Scope.MODULE);
comp.getImplementation().setComponentType(getIntrospector().introspect(DefaultPolicyBuilderRegistry.class));
ctx.registerModelObject(comp);
comp = systemFactory.createSystemComponent(MESSAGE_FACTORY, MessageFactory.class, MessageFactoryImpl.class, Scope.MODULE);
comp.getImplementation().setComponentType(getIntrospector().introspect(MessageFactoryImpl.class));
ctx.registerModelObject(comp);
comp = systemFactory.createSystemComponent(PROXY_FACTORY_FACTORY, WireFactoryFactory.class, JDKWireFactoryFactory.class, Scope.MODULE);
comp.getImplementation().setComponentType(getIntrospector().introspect(JDKWireFactoryFactory.class));
ctx.registerModelObject(comp);
comp = systemFactory.createSystemComponent(WIRE_FACTORY_SERVICE, org.apache.tuscany.core.wire.service.WireFactoryService.class, DefaultWireFactoryService.class, Scope.MODULE);
comp.getImplementation().setComponentType(getIntrospector().introspect(DefaultWireFactoryService.class));
ctx.registerModelObject(comp);
comp = systemFactory.createSystemComponent(JAVA_BUILDER, ContextFactoryBuilder.class, JavaContextFactoryBuilder.class, Scope.MODULE);
comp.getImplementation().setComponentType(getIntrospector().introspect(JavaContextFactoryBuilder.class));
ctx.registerModelObject(comp);
comp = systemFactory.createSystemComponent(JAVA_WIRE_BUILDER, WireBuilder.class, JavaTargetWireBuilder.class, Scope.MODULE);
comp.getImplementation().setComponentType(getIntrospector().introspect(JavaTargetWireBuilder.class));
ctx.registerModelObject(comp);
ctx.publish(new ModuleStart(new Object()));
return runtime;
}