Package org.apache.tuscany.model.assembly

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


        AtomicComponent[] ca = new AtomicComponent[3];
        ca[0] = MockFactory.createComponent("one", SessionScopedOrderedInitPojo.class, Scope.SESSION);
        ca[1] = MockFactory.createComponent("two", SessionScopedOrderedInitPojo.class, Scope.SESSION);
        ca[2] = MockFactory.createComponent("three", SessionScopedOrderedInitPojo.class, Scope.SESSION);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(SessionScopedOrderedInitPojo.class);
        ca[0].getImplementation().setComponentType(type);
        ca[1].getImplementation().setComponentType(type);
        ca[2].getImplementation().setComponentType(type);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        for (AtomicComponent aCa : ca) {
View Full Code Here


    /**
     * Tests the case where a component's scope is specified by its superclass
     */
    public void testParentScopeEvaluation() throws Exception {
        ComponentType type = factory.createComponentType();
        introspector.introspect(ScopeTestComponent.class, type);
        assertEquals(1, type.getServices().size());
        ServiceContract contract = type.getServices().get(0).getServiceContract();
        assertEquals(Scope.MODULE, contract.getScope());
    }
View Full Code Here

     * (property.getName().equals("fooRequired")) { assertTrue(property.isRequired()); } else {
     * assertFalse(property.isRequired()); } } } *
     */

    public void testReferenceProcessing() throws Exception {
        ComponentType type = factory.createComponentType();
        introspector.introspect(TestComponentImpl.class, type);
        List<Reference>references = type.getReferences();
        assertEquals(5, references.size());
        for (Reference reference : references) {
            if (reference.getName().equals("setBarRequired")) {
                assertTrue(reference.getMultiplicity() == Multiplicity.ONE_N);
            } else if (reference.getName().equals("setBar")) {
View Full Code Here

                Scope.MODULE);
        ca[1] = MockFactory.createComponent("TestServiceEagerInit", ModuleScopeEagerInitComponent.class,
                Scope.MODULE);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(OrderedInitPojo.class);
        ca[0].getImplementation().setComponentType(introspector.introspect(ModuleScopeEagerInitDestroyComponent.class));
        ca[1].getImplementation().setComponentType(introspector.introspect(ModuleScopeEagerInitComponent.class));
        for (AtomicComponent aCa : ca) {
            builder.build(aCa);
            configs.add((ContextFactory<Context>) aCa.getContextFactory());
View Full Code Here

        ca[0] = MockFactory.createComponent("one", OrderedInitPojo.class, Scope.MODULE);
        ca[1] = MockFactory.createComponent("two", OrderedInitPojo.class, Scope.MODULE);
        ca[2] = MockFactory.createComponent("three", OrderedInitPojo.class, Scope.MODULE);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(OrderedInitPojo.class);
        ca[0].getImplementation().setComponentType(type);
        ca[1].getImplementation().setComponentType(type);
        ca[2].getImplementation().setComponentType(type);
        for (AtomicComponent aCa : ca) {
            builder.build(aCa);
View Full Code Here

        AtomicComponent[] ca = new AtomicComponent[3];
        ca[0] = MockFactory.createComponent("one", OrderedEagerInitPojo.class, Scope.MODULE);
        ca[1] = MockFactory.createComponent("two", OrderedEagerInitPojo.class, Scope.MODULE);
        ca[2] = MockFactory.createComponent("three", OrderedEagerInitPojo.class, Scope.MODULE);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(OrderedEagerInitPojo.class);
        ca[0].getImplementation().setComponentType(type);
        ca[1].getImplementation().setComponentType(type);
        ca[2].getImplementation().setComponentType(type);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        for (AtomicComponent aCa : ca) {
View Full Code Here

        jsc.setInterface(service);
        jsc.setScope(scope);
        Service s = createService();
        s.setServiceContract(jsc);

        ComponentType componentType = createComponentType();
        componentType.getServices().add(s);

        SystemImplementation sysImpl = createSystemImplementation();
        sysImpl.setImplementationClass(impl);
        sysImpl.setComponentType(componentType);
View Full Code Here

        AtomicComponent[] ca = new AtomicComponent[3];
        ca[0] = MockFactory.createComponent("one", RequestScopedOrderedInitPojo.class, Scope.REQUEST);
        ca[1] = MockFactory.createComponent("two", RequestScopedOrderedInitPojo.class, Scope.REQUEST);
        ca[2] = MockFactory.createComponent("three", RequestScopedOrderedInitPojo.class, Scope.REQUEST);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(RequestScopedOrderedInitPojo.class);
        ca[0].getImplementation().setComponentType(type);
        ca[1].getImplementation().setComponentType(type);
        ca[2].getImplementation().setComponentType(type);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        for (AtomicComponent aCa : ca) {
View Full Code Here

        Component target = systemFactory.createSystemComponent("target", Target.class, TargetImpl.class, targetScope);
        target.initialize(assemblyContext);

        // create the source componentType
        Component source = systemFactory.createSystemComponent("source", Source.class, SourceImpl.class, sourceScope);
        ComponentType sourceComponentType = source.getImplementation().getComponentType();
        List<Reference> references = sourceComponentType.getReferences();
        List<ConfiguredReference> configuredReferences = source.getConfiguredReferences();

        // wire source to target
        references.add(systemFactory.createReference("setTarget", Target.class));
        ConfiguredReference configuredReference = systemFactory.createConfiguredReference("setTarget", "target");
View Full Code Here

    }

    public JavaScriptImplementation load(XMLStreamReader reader, LoaderContext loaderContext) throws XMLStreamException, ConfigurationLoadException {
        String scriptFile = reader.getAttributeValue(null, "scriptFile");
        String script = loadScript(scriptFile, loaderContext.getResourceLoader());
        ComponentType componentType = loadComponentType(scriptFile, loaderContext);

        JavaScriptImplementation jsImpl = new JavaScriptImplementation();
        jsImpl.setComponentType(componentType);
        jsImpl.setScriptFile(scriptFile);
        jsImpl.setScript(script);
View Full Code Here

TOP

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

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.