Package org.apache.tuscany.sca.assembly

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


    public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
       
        // Process each node component in the given composite
        for (Component component: composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof NodeImplementation) {
               
                // Get the application composite assigned to the node
                NodeImplementation nodeImplementation = (NodeImplementation)implementation;
                Composite applicationComposite = nodeImplementation.getComposite();
View Full Code Here


    public void resolve(Object bean, ModelResolver resolver) throws ContributionResolveException {
       
        // Resolve and merge the component type associated with an
        // implementation model
        if (bean instanceof Implementation) {
            Implementation implementation = (Implementation)bean;
            String uri = implementation.getURI();
            if (uri != null) {
                int d = uri.lastIndexOf('.');
                if (d != -1) {
                    uri = uri.substring(0, d) + ".componentType";
                   
                    // Resolve the component type
                    ComponentType componentType = assemblyFactory.createComponentType();
                    componentType.setURI(uri);
                    componentType.setUnresolved(true);
                   
                    componentType = resolver.resolveModel(ComponentType.class, componentType);
                    if (componentType != null && !componentType.isUnresolved()) {
                       
                        // We found a component type, merge it into the implementation model
                        implementation.getServices().addAll(componentType.getServices());
                        implementation.getReferences().addAll(componentType.getReferences());
                        implementation.getProperties().addAll(componentType.getProperties());
                        implementation.setConstrainingType(componentType.getConstrainingType());
                       
                        if (implementation instanceof PolicySetAttachPoint &&
                                componentType instanceof PolicySetAttachPoint ) {
                            PolicySetAttachPoint policiedImpl = (PolicySetAttachPoint)implementation;
                            PolicySetAttachPoint policiedCompType = (PolicySetAttachPoint)componentType;
View Full Code Here

           
            //write extended attributes
            this.writeExtendedAttributes(writer, component, extensionAttributeProcessor);
           
            // Write the component implementation
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                writeStart(writer, IMPLEMENTATION_COMPOSITE, new XAttr(NAME, ((Composite)implementation).getName()));
               
                //write extended attributes
                this.writeExtendedAttributes(writer, (Composite)implementation, extensionAttributeProcessor);
View Full Code Here

                    }
                }
            }
           
            //resolve component implementation
            Implementation implementation = component.getImplementation();
            if (implementation != null) {
                try {
                    //resolve intents and policysets specified on this implementation
                    //before copying them over to the component.  Before that, from the component
                    //copy over the applicablePolicySets alone as it might have to be
View Full Code Here

        Contract contract = wire.getSource().getContract();
        if (!(contract instanceof RuntimeComponentReference)) {
            return;
        }
        RuntimeComponent component = wire.getSource().getComponent();
        Implementation implementation = component.getImplementation();
        if (!(implementation instanceof JavaImplementation)) {
            return;
        }
        JavaImplementation javaImpl = (JavaImplementation)implementation;
        EndpointReference callbackEndpoint = wire.getSource().getCallbackEndpoint();
View Full Code Here

    public void resolve(Object bean, ModelResolver resolver) throws ContributionResolveException {
       
        // Resolve and merge the component type associated with an
        // implementation model
        if (bean instanceof Implementation) {
            Implementation implementation = (Implementation)bean;
            String uri = implementation.getURI();
            if (uri != null) {
                int d = uri.lastIndexOf('.');
                if (d != -1) {
                    uri = uri.substring(0, d) + ".componentType";
                   
                    // Resolve the component type
                    ComponentType componentType = assemblyFactory.createComponentType();
                    componentType.setURI(uri);
                    componentType.setUnresolved(true);
                   
                    componentType = resolver.resolveModel(ComponentType.class, componentType);
                    if (componentType != null && !componentType.isUnresolved()) {
                       
                        // We found a component type, merge it into the implementation model
                        implementation.getServices().addAll(componentType.getServices());
                        implementation.getReferences().addAll(componentType.getReferences());
                        implementation.getProperties().addAll(componentType.getProperties());
                        implementation.setConstrainingType(componentType.getConstrainingType());
                       
                        if (implementation instanceof PolicySubject &&
                                componentType instanceof PolicySubject ) {
                            PolicySubject policiedImpl = (PolicySubject)implementation;
                            PolicySubject policiedCompType = (PolicySubject)componentType;
View Full Code Here

           
            //write extended attributes
            this.writeExtendedAttributes(writer, component, extensionAttributeProcessor);
           
            // Write the component implementation
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                writeStart(writer, IMPLEMENTATION_COMPOSITE, new XAttr(NAME, ((Composite)implementation).getName()));
               
                //write extended attributes
                this.writeExtendedAttributes(writer, (Composite)implementation, extensionAttributeProcessor);
View Full Code Here

                    }
                }
            }
           
            //resolve component implementation
            Implementation implementation = component.getImplementation();
            if (implementation != null) {
                //now resolve the implementation so that even if there is a shared instance
                //for this that is resolved, the specified intents and policysets are safe in the
                //component and not lost
                implementation = resolveImplementation(implementation, resolver);
View Full Code Here

    public void build(Composite composite, Definitions definitions, Monitor monitor) throws CompositeBuilderException {
       
        // Process each node component in the given composite
        for (Component component: composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof NodeImplementation) {
               
                // Get the application composite assigned to the node
                NodeImplementation nodeImplementation = (NodeImplementation)implementation;
                Composite applicationComposite = nodeImplementation.getComposite();
View Full Code Here

     * @param problems
     */
    protected void connectCompositeReferencesAndServices(Composite composite, Monitor monitor){
        // Wire nested composites recursively
        for (Component component : composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                connectCompositeReferencesAndServices((Composite)implementation, monitor);
            }
        }

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.