Package org.apache.tuscany.model.assembly

Examples of org.apache.tuscany.model.assembly.ModuleComponent


    /**
     * Creates an composite component with the given name
     */
    public static ModuleComponent createSystemCompositeComponent(String name) {
        ModuleComponent sc = systemFactory.createModuleComponent();
        SystemModule impl = systemFactory.createSystemModule();
        impl.setImplementationClass(SystemCompositeContextImpl.class);
        sc.setImplementation(impl);
        Service s = systemFactory.createService();
        JavaServiceContract ji = systemFactory.createJavaServiceContract();
        s.setServiceContract(ji);
        ji.setScope(Scope.AGGREGATE);
        impl.setComponentType(systemFactory.createComponentType());
        impl.getComponentType().getServices().add(s);
        sc.setName(name);
        sc.setImplementation(impl);
        return sc;
    }
View Full Code Here


    /**
     * Creates an composite component with the given name
     */
    public static ModuleComponent createCompositeComponent(String name) throws ConfigurationLoadException {
        ModuleComponent sc = systemFactory.createModuleComponent();
        Module impl = systemFactory.createModule();
        impl.setName(name);
        //impl.setImplementationClass(CompositeContextImpl.class);
        sc.setImplementation(impl);
        impl.setImplementationClass(CompositeContextImpl.class);
        impl.setComponentType(getCompositeComponentType());
        Service s = systemFactory.createService();
        JavaServiceContract ji = systemFactory.createJavaServiceContract();
        s.setServiceContract(ji);
        ji.setScope(Scope.AGGREGATE);
//        impl.setComponentType(systemFactory.createComponentType());
        impl.getComponentType().getServices().add(s);
        sc.setName(name);
        sc.setImplementation(impl);
        return sc;
    }
View Full Code Here

    /**
     * Creates an composite component with the given name
     */
    public static ModuleComponent createSystemCompositeComponent(String name) throws ConfigurationLoadException {
        ModuleComponent sc = systemFactory.createModuleComponent();
        SystemModule impl = systemFactory.createSystemModule();
        impl.setName(name);
        impl.setImplementationClass(SystemCompositeContextImpl.class);
        impl.setComponentType(getComponentType());
        sc.setImplementation(impl);
        Service s = systemFactory.createService();
        JavaServiceContract ji = systemFactory.createJavaServiceContract();
        s.setServiceContract(ji);
        ji.setScope(Scope.AGGREGATE);
        //impl.setComponentType(systemFactory.createComponentType());
        impl.getComponentType().getServices().add(s);
        sc.setName(name);
        sc.setImplementation(impl);
        return sc;
    }
View Full Code Here

     * @see org.apache.tuscany.core.mock.component.Source
     * @see org.apache.tuscany.core.mock.component.Target
     */
    public static ModuleComponent createSystemModuleComponentWithWiredComponents(String moduleComponentName, Scope sourceScope,
                                                                                 Scope targetScope) throws ConfigurationLoadException {
        ModuleComponent mc = systemFactory.createModuleComponent();
        mc.setName(moduleComponentName);
        mc.setImplementation(createSystemModuleWithWiredComponents(moduleComponentName + ".module", sourceScope, targetScope));
        return mc;
    }
View Full Code Here

        monitor.started(runtime);

        // Load and start the system configuration
        SystemAggregateContext systemContext = runtime.getSystemContext();
        ModuleComponentConfigurationLoader loader = BootstrapHelper.getConfigurationLoader(systemContext, modelContext);
        ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT);
        AggregateContext context = BootstrapHelper.registerModule(systemContext, systemModuleComponent);
        context.fireEvent(EventContext.MODULE_START, null);

        // Load the SCDL configuration of the application module
        AggregateContext rootContext = runtime.getRootContext();
View Full Code Here

    }

    private static AggregateContext bootstrapStaxLoader(SystemAggregateContext systemContext, AssemblyModelContext modelContext) throws ConfigurationException {
        AggregateContext loaderContext = (AggregateContext) systemContext.getContext(SYSTEM_LOADER_COMPONENT);
        if (loaderContext == null) {
            ModuleComponent loaderComponent = StAXUtil.bootstrapLoader(SYSTEM_LOADER_COMPONENT, modelContext);
            loaderContext = registerModule(systemContext, loaderComponent);
            loaderContext.fireEvent(EventContext.MODULE_START, null);
        }
        return loaderContext;
    }
View Full Code Here

    }

    private static AggregateContext bootstrapStaxLoader(SystemAggregateContext systemContext, AssemblyModelContext modelContext) throws ConfigurationException {
        AggregateContext loaderContext = (AggregateContext) systemContext.getContext(SYSTEM_LOADER_COMPONENT);
        if (loaderContext == null) {
            ModuleComponent loaderComponent = StAXUtil.bootstrapLoader(SYSTEM_LOADER_COMPONENT, modelContext);
            loaderContext = registerModule(systemContext, loaderComponent);
            loaderContext.fireEvent(EventContext.MODULE_START, null);
        }
        return loaderContext;
    }
View Full Code Here

        monitor.started(runtime);

        // Load and start the system configuration
        SystemAggregateContext systemContext = runtime.getSystemContext();
        ModuleComponentConfigurationLoader loader = BootstrapHelper.getConfigurationLoader(systemContext, modelContext);
        ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT);
        AggregateContext context = BootstrapHelper.registerModule(systemContext, systemModuleComponent);
        context.fireEvent(EventContext.MODULE_START, null);

        // Load the SCDL configuration of the application module
        AggregateContext rootContext = runtime.getRootContext();
View Full Code Here

TOP

Related Classes of org.apache.tuscany.model.assembly.ModuleComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.