Package org.apache.tuscany.sca.assembly

Examples of org.apache.tuscany.sca.assembly.Implementation


                writeEnd(writer);
            }

            // Write the component implementation
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                writeStart(writer, IMPLEMENTATION_COMPOSITE, new XAttr(NAME,
                        composite.getName()));
                writeEnd(writer);
            } else {
View Full Code Here


                constrainingType = resolver.resolveModel(
                        ConstrainingType.class, constrainingType);
                component.setConstrainingType(constrainingType);
            }

            Implementation implementation = component.getImplementation();
            if (implementation != null) {
                implementation = resolveImplementation(implementation, resolver);
                component.setImplementation(implementation);
            }
View Full Code Here

            constrainingType = resolver.resolveModel(ConstrainingType.class,
                    constrainingType);
            component.setConstrainingType(constrainingType);
        }

        Implementation implementation = component.getImplementation();
        if (implementation != null) {
            implementation = resolveImplementation(implementation, resolver);
            component.setImplementation(implementation);
        }
View Full Code Here

                    bindingProvider.start();
                }
            }
        }

        Implementation implementation = component.getImplementation();
        if (implementation instanceof Composite) {
            start((Composite)implementation);
        } else {
            ImplementationProvider implementationProvider = runtimeComponent.getImplementationProvider();
            if (implementationProvider != null) {
View Full Code Here

                if (bindingProvider != null) {
                    bindingProvider.stop();
                }
            }
        }
        Implementation implementation = component.getImplementation();
        if (implementation instanceof Composite) {
            stop((Composite)implementation);
        } else {
            ImplementationProvider implementationProvider = ((RuntimeComponent)component).getImplementationProvider();
            if (implementationProvider != null) {
View Full Code Here

            for (Component component : composite.getComponents()) {
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("Activating component: " + component.getURI());
                }

                Implementation implementation = component.getImplementation();
                if (implementation instanceof Composite) {
                    activate((Composite)implementation);
                } else if (implementation != null) {
                    addImplementationProvider((RuntimeComponent)component, implementation);
                    addScopeContainer(component);
View Full Code Here

                for (ComponentReference reference : component.getReferences()) {
                    deactivate((RuntimeComponent)component, (RuntimeComponentReference)reference);
                }

                Implementation implementation = component.getImplementation();
                if (implementation instanceof Composite) {
                    deactivate((Composite)implementation);
                } else if (implementation != null) {
                    removeImplementationProvider((RuntimeComponent)component);
                    removeScopeContainer(component);
View Full Code Here

            String uri = component.getURI();
            if (uri.equals(componentURI)) {
                return component;
            }
            if (componentURI.startsWith(uri)) {
                Implementation implementation = component.getImplementation();
                if (!(implementation instanceof Composite)) {
                    return null;
                }
                return resolve((Composite)implementation, componentURI);
            }
View Full Code Here

        c.setName(name);

        ConstrainingType constraint = createConstrainingType();
        c.setConstrainingType(constraint);

        Implementation i = new TestImplementation(factory);
        c.setImplementation(i);

        ComponentProperty p = factory.createComponentProperty();
        p.setName("currency");
        p.setValue("USD");
        p.setMustSupply(true);
        p.setXSDType(new QName("", ""));
        p.setProperty(i.getProperties().get(0));
        c.getProperties().add(p);

        ComponentReference ref1 = factory.createComponentReference();
        ref1.setName("accountDataService");
        ref1.setMultiplicity(Multiplicity.ONE_ONE);
        ref1.setInterfaceContract(new TestInterfaceContract(factory));
        ref1.setReference(i.getReferences().get(0));
        c.getReferences().add(ref1);
        ref1.getBindings().add(new TestBinding(factory));

        ComponentReference ref2 = factory.createComponentReference();
        ref2.setName("stockQuoteService");
        ref2.setMultiplicity(Multiplicity.ONE_ONE);
        ref2.setInterfaceContract(new TestInterfaceContract(factory));
        ref2.setReference(i.getReferences().get(1));
        c.getReferences().add(ref2);
        ref2.getBindings().add(new TestBinding(factory));

        ComponentService s = factory.createComponentService();
        s.setName("AccountService");
        s.setInterfaceContract(new TestInterfaceContract(factory));
        s.setService(i.getServices().get(0));
        c.getServices().add(s);
        s.getBindings().add(new TestBinding(factory));

        return c;
    }
View Full Code Here

                       new XAttr(URI, component.getURI()),
                       new XAttr(AUTOWIRE, component.getAutowire()),
                       policyProcessor.writePolicies(component));
           
            // Write the component implementation
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                writeStart(writer, IMPLEMENTATION_COMPOSITE, new XAttr(NAME, composite.getName()));
                writeEnd(writer);
            } else {
                extensionProcessor.write(component.getImplementation(), writer);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.assembly.Implementation

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.