Package org.apache.tuscany.sca.assembly

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


     */
    private void configureNestedCompositeReferences(Composite composite, Monitor monitor) {
   
        // Process nested composites recursively
        for (Component component : composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                configureNestedCompositeReferences((Composite)implementation, monitor);
            }
        }
   
        // Process component references declared on components in this composite
        for (Component component : composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                for (ComponentReference componentReference : component.getReferences()) {
                    Reference implReference = componentReference.getReference();
                    if (implReference != null && implReference instanceof CompositeReference) {

View Full Code Here


    private void processComponentServices(Composite composite) {

        for (Component component : composite.getComponents()) {
          
            // recurse for composite implementations
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                processComponentServices((Composite)implementation);
            }

            // create an endpoint for each component service binding
View Full Code Here

    protected void indexImplementationPropertiesServicesAndReferences(
            Component component, Map<String, Service> services,
            Map<String, Reference> references,
            Map<String, Property> properties, Monitor monitor) {
        // First check that the component has a resolved implementation
        Implementation implementation = component.getImplementation();
        if (implementation == null) {
            // A component must have an implementation
            warning(monitor, "NoComponentImplementation", component, component
                    .getName());

        } else if (implementation.isUnresolved()) {

            // The implementation must be fully resolved
            warning(monitor, "UnresolvedComponentImplementation", component,
                    component.getName(), implementation.getURI());

        } else {

            // Index properties, services and references, also check for
            // duplicates
            for (Property property : implementation.getProperties()) {
                if (properties.containsKey(property.getName())) {
                    warning(monitor, "DuplicateImplementationPropertyName",
                            component, component.getName(), property.getName());
                } else {
                    properties.put(property.getName(), property);
                }
            }
            for (Service service : implementation.getServices()) {
                if (services.containsKey(service.getName())) {
                    warning(monitor, "DuplicateImplementationServiceName",
                            component, component.getName(), service.getName());
                } else {
                    services.put(service.getName(), service);
                }
            }
            for (Reference reference : implementation.getReferences()) {
                if (references.containsKey(reference.getName())) {
                    warning(monitor, "DuplicateImplementationReferenceName",
                            component, component.getName(), reference.getName());
                } else {
                    references.put(reference.getName(), reference);
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((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

                    });                      
                }
            }
        }

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

                          }
                    });                      
                }
            }             
        }
        Implementation implementation = component.getImplementation();
        if (implementation instanceof Composite) {
            stop((Composite)implementation);
        } else {
            final ImplementationProvider implementationProvider = ((RuntimeComponent)component).getImplementationProvider();
            if (implementationProvider != null) {
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

    protected void computePolicies(Composite composite, Definitions definitions, Monitor monitor) {

        // compute policies recursively
        for (Component component : composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {
                computePolicies((Composite)implementation, definitions, monitor);
            }
        }

        for (Component component : composite.getComponents()) {
            isMutualExclusive(component, component.getImplementation());

            for (ComponentService componentService : component.getServices()) {
                isMutualExclusive(componentService, componentService.getService());

                if (componentService.getInterfaceContract() != null) {
                    isMutualExclusive(componentService.getInterfaceContract().getInterface(), componentService
                        .getService().getInterfaceContract().getInterface());
                    isMutualExclusive(componentService.getInterfaceContract().getCallbackInterface(), componentService
                        .getService().getInterfaceContract().getCallbackInterface());
                }

                for (Endpoint2 ep : componentService.getEndpoints()) {
                    // Inherit from the componentType.service.interface
                    if (componentService.getService() != null && componentService.getService().getInterfaceContract() != null) {
                        inherit(ep, componentService.getService().getInterfaceContract().getInterface());
                    }
                    if (componentService.getInterfaceContract() != null) {
                        // Inherit from the component.service.interface
                        inherit(ep, componentService.getInterfaceContract().getInterface());
                    }
                    // Inherit from the componentType/service
                    inheritFromService(ep, composite, component, componentService.getService());
                    // Find the corresponding binding in the componentType and inherit the intents/policySets
                    if (componentService.getService() != null) {
                        for (Binding binding : componentService.getService().getBindings()) {
                            if (isEqual(ep.getBinding().getName(), binding.getName()) && (binding instanceof PolicySubject)) {
                                isMutualExclusive((PolicySubject)ep.getBinding(), (PolicySubject)binding);
                                // Inherit from componentType.service.binding
                                inherit(ep, binding);
                                break;
                            }
                        }
                    }
                    // Inherit from composite/component/service
                    inheritFromService(ep, composite, ep.getComponent(), ep.getService());
                    // Inherit from binding
                    inherit(ep, ep.getBinding());

                    // Replace profile intents with their required intents
                    // Remove the intents whose @contraints do not include the current element
                    // Replace unqualified intents if there is a qualified intent in the list
                    // Replace qualifiable intents with the default qualied intent
                    resolveAndNormalize(ep, definitions, monitor);
                }
            }

            for (ComponentReference componentReference : component.getReferences()) {
                isMutualExclusive(componentReference, componentReference.getReference());

                if (componentReference.getInterfaceContract() != null) {
                    isMutualExclusive(componentReference.getInterfaceContract().getInterface(), componentReference
                        .getReference().getInterfaceContract().getInterface());
                    isMutualExclusive(componentReference.getInterfaceContract().getCallbackInterface(),
                                      componentReference.getReference().getInterfaceContract().getCallbackInterface());
                }

                for (EndpointReference2 epr : componentReference.getEndpointReferences()) {
                    // Inherit from the componentType.reference.interface
                    if (componentReference.getReference() != null && componentReference.getReference()
                        .getInterfaceContract() != null) {
                        inherit(epr, componentReference.getReference().getInterfaceContract().getInterface());
                    }
                    // Inherit from the component.reference.interface
                    if (componentReference.getInterfaceContract() != null) {
                        inherit(epr, componentReference.getInterfaceContract().getInterface());
                    }
                    // Inherit from the componentType/reference
                    inheritFromReference(epr, composite, component, componentReference.getReference());
                    // Find the corresponding binding in the componentType and inherit the intents/policySets
                    if (componentReference.getReference() != null) {
                        for (Binding binding : componentReference.getReference().getBindings()) {
                            if (epr.getBinding() != null && isEqual(epr.getBinding().getName(), binding.getName())
                                && (binding instanceof PolicySubject)) {
                                isMutualExclusive((PolicySubject)epr.getBinding(), (PolicySubject)binding);
                                // Inherit from componentType.reference.binding
                                inherit(epr, binding);
                                break;
                            }
                        }
                    }
                    // Inherit from composite/component/reference/binding
                    inheritFromReference(epr, composite, epr.getComponent(), epr.getReference());
                    inherit(epr, epr.getBinding());

                    // Replace profile intents with their required intents
                    // Remove the intents whose @contraints do not include the current element
                    // Replace unqualified intents if there is a qualified intent in the list
                    // Replace qualifiable intents with the default qualied intent
                    resolveAndNormalize(epr, definitions, monitor);
                }
            }

            Implementation implementation = component.getImplementation();
            // How to deal with implementation level policySets/intents
        }
    }
View Full Code Here

    private void configureNestedCompositeServices(Composite composite) {

        // Process nested composites recursively
        for (Component component : composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof Composite) {

                // First process nested composites
                configureNestedCompositeServices((Composite)implementation);
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.