Package org.apache.tuscany.sca.assembly

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


     *
     * @param component
     * @return true if the implementation is present and resolved
     */
    private boolean isComponentImplementationPresent(Component component, Monitor monitor){
        Implementation implementation = component.getImplementation();
        if (implementation == null) {
            // A component must have an implementation
            Monitor.error(monitor,
                          this,
                          Messages.ASSEMBLY_VALIDATION,
                          "NoComponentImplementation",
                          component.getName());
            return false;
        } else if (implementation.isUnresolved()) {
            // The implementation must be fully resolved
            Monitor.error(monitor,
                          this,
                          Messages.ASSEMBLY_VALIDATION,
                          "UnresolvedComponentImplementation",
                          component,
                          component.getName(),
                          implementation.getURI());
            return false;
        }       
       
        return true;
    }
View Full Code Here


     * this component.
     *
     * @param component
     */
    private void createComponentType(Component component, BuilderContext context) {
        Implementation implementation = component.getImplementation();
        if (implementation instanceof Composite) {
            componentTypeBuilder.createComponentType(component, (Composite)implementation, context);
        }
    }
View Full Code Here

                        }
                    }                
                    implReference = implCompReference;
                   
                    // Add the composite reference to the composite implementation artifact
                    Implementation implementation = component.getImplementation();
                    if (implementation != null && implementation instanceof Composite) {
                        ((Composite)implementation).getReferences().add(implCompReference);
                    }
                } else {
                    implReference = assemblyFactory.createReference();
View Full Code Here

                        }
                    }
                   
                    implService = implCompService;
                    // Add the composite service to the composite implementation artifact
                    Implementation implementation = component.getImplementation();
                    if (implementation != null && implementation instanceof Composite) {
                        ((Composite)implementation).getServices().add(implCompService);
                    } // end if
                    //
                } else {
View Full Code Here

        monitor.pushContext("Composite: " + composite.getName().toString());
        try {
            // Process nested composites recursively
            for (Component component : composite.getComponents()) {
                Implementation implementation = component.getImplementation();
                if (implementation instanceof Composite) {
                    // Process nested composite
                    configureBindingURIs((Composite)implementation, component.getURI(), definitions, defaultBindings, monitor);
                }
            }
View Full Code Here

    }
   
    private void populateLocalRegistry(Composite composite, DomainRegistry registry, BuilderContext context){
        for (Component component : composite.getComponents()) {
            // recurse for composite implementations
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                populateLocalRegistry((Composite)implementation, registry, context);
            }
           
            // add all endpoints to the local registry
View Full Code Here

                //resolve component level
                resolveAndCheck(component, context);
               
                try {
                    Implementation implementation = component.getImplementation();
                   
                    for (ComponentService componentService : component.getServices()) {
                        monitor.pushContext("Service: " + componentService.getName());

                        try {
View Full Code Here

    protected void buildPolicies(Composite composite, BuilderContext context) {

        // build policies recursively
        for (Component component : composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                buildPolicies((Composite)implementation, context);
            }
        }

        for (Component component : composite.getComponents()) {

            for (ComponentService componentService : component.getServices()) {
                for (Endpoint ep : componentService.getEndpoints()) {
                    Set<String> policyNames = getPolicyNames(ep);
                   
                    // check that only one policy language is present in the endpoint's policy sets
                    if (policyNames.size() > 1){
                        error(context.getMonitor(),
                              "MultiplePolicyLanguagesInEP",
                              this,
                              ep.toString(),
                              policyNames.toString());
                    } else {
                        for (PolicySet ps : ep.getPolicySets()) {
                            for (PolicyExpression exp : ps.getPolicies()) {
                                PolicyBuilder builder = builders.getPolicyBuilder(exp.getName());
                                if (builder != null) {
                                    builder.build(ep, context);
                                }               
                            }
                        }                       
                    }
                }
            }

            for (ComponentReference componentReference : component.getReferences()) {
                for (EndpointReference epr : componentReference.getEndpointReferences()) {
                    Set<String> policyNames = getPolicyNames(epr);
                   
                    // check that only one policy language is present in the endpoint references's policy sets
                    if (policyNames.size() > 1){
                        error(context.getMonitor()
                              "MultiplePolicyLanguagesInEPR",
                              this,
                              epr.toString(),
                              policyNames.toString());
                    } else {                   
                        for (PolicySet ps : epr.getPolicySets()) {
                            for (PolicyExpression exp : ps.getPolicies()) {
                                PolicyBuilder builder = builders.getPolicyBuilder(exp.getName());
                                if (builder != null) {
                                    builder.build(epr, context);
                                }
                            }
                        }
                    }
                }
            }

            Implementation implementation = component.getImplementation();
            if (implementation != null) {
                Set<String> policyNames = getPolicyNames(implementation);
               
                // check that only one policy language is present in the implementations's policy sets
                if (policyNames.size() > 1){
                    error(context.getMonitor(),
                          "MultiplePolicyLanguagesInImplementation",
                          this,
                          component.toString(),
                          policyNames.toString());
                } else {
                    for (PolicySet ps : implementation.getPolicySets()) {
                        for (PolicyExpression exp : ps.getPolicies()) {                   
                            PolicyBuilder builder = builders.getPolicyBuilder(exp.getName());
                            if (builder != null) {
                                builder.build(component, implementation, context);
                            }
View Full Code Here

        try {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Activating component: " + component.getURI());
            }

            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                activate(compositeContext, (Composite) implementation);
            } else if (implementation != null) {
                addImplementationProvider((RuntimeComponent) component,
                        implementation);
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

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.