Examples of ExtensionType


Examples of org.apache.tuscany.sca.policy.ExtensionType

                                            composite.getExtensions().add(extension);
                                        }
                                    }
                                } else if (extension instanceof Binding) {
                                    if ( extension instanceof PolicySubject ) {
                                        ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
                                        bindingType.setType(name);
                                        bindingType.setUnresolved(true);
                                        ((PolicySubject)extension).setType(bindingType);
                                    }
                                    // <service><binding> and
                                    // <reference><binding>
                                    if (callback != null) {
                                        callback.getBindings().add((Binding)extension);
                                    } else {
                                        if (contract != null) {
                                            contract.getBindings().add((Binding)extension);
                                        } else {
                                            if (name.getNamespaceURI().equals(SCA11_NS)) {
                                              error("UnexpectedBindingElement", extension);
                                                //throw new ContributionReadException("Unexpected <binding> element found. It should appear inside a <service> or <reference> element");
                                            } else {
                                                composite.getExtensions().add(extension);
                                            }
                                        }
                                    }
   
                                } else if (extension instanceof Implementation) {
                                    if ( extension instanceof PolicySubject ) {
                                        ExtensionType implType = intentAttachPointTypeFactory.createImplementationType();
                                        implType.setType(name);
                                        implType.setUnresolved(true);
                                        ((PolicySubject)extension).setType(implType);
                                    }
                                    // <component><implementation>
                                    if (component != null) {
                                        component.setImplementation((Implementation)extension);
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

        return SCABinding.class;
    }

    public SCABinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
        SCABinding scaBinding = scaBindingFactory.createSCABinding();
        ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
        bindingType.setType(getArtifactType());
        bindingType.setUnresolved(true);
        ((PolicySubject)scaBinding).setType(bindingType);
       
        // Read policies
        policyProcessor.readPolicies(scaBinding, reader);
       
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

                                            composite.getExtensions().add(extension);
                                        }
                                    }
                                } else if (extension instanceof Binding) {
                                    if ( extension instanceof PolicySubject ) {
                                        ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
                                        bindingType.setType(name);
                                        bindingType.setUnresolved(true);
                                        ((PolicySubject)extension).setType(bindingType);
                                    }
                                    // <service><binding> and
                                    // <reference><binding>
                                    if (callback != null) {
                                        callback.getBindings().add((Binding)extension);
                                    } else {
                                        if (contract != null) {
                                            contract.getBindings().add((Binding)extension);
                                        } else {
                                            if (name.getNamespaceURI().equals(SCA10_NS)) {
                                                error("UnexpectedBindingElement", extension);
                                                //throw new ContributionReadException("Unexpected <binding> element found. It should appear inside a <service> or <reference> element");
                                            } else {
                                                composite.getExtensions().add(extension);
                                            }
                                        }
                                    }
   
                                } else if (extension instanceof Implementation) {
                                    if ( extension instanceof PolicySubject ) {
                                        ExtensionType implType = intentAttachPointTypeFactory.createImplementationType();
                                        implType.setType(name);
                                        implType.setUnresolved(true);
                                        ((PolicySubject)extension).setType(implType);
                                    }
                                    // <component><implementation>
                                    if (component != null) {
                                        component.setImplementation((Implementation)extension);
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

    public JavaImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {

        // Read an <implementation.java>
        JavaImplementation javaImplementation = javaFactory.createJavaImplementation();

        ExtensionType implType = policyFactory.createImplementationType();
        implType.setType(getArtifactType());
        implType.setUnresolved(true);
        javaImplementation.setType(implType);

        javaImplementation.setUnresolved(true);
        javaImplementation.setName(reader.getAttributeValue(null, CLASS));
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

    public JavaImplementation read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {

        // Read an <implementation.java>
        JavaImplementation javaImplementation = javaFactory.createJavaImplementation();

        ExtensionType implType = policyFactory.createImplementationType();
        implType.setType(getArtifactType());
        implType.setUnresolved(true);
        javaImplementation.setExtensionType(implType);

        javaImplementation.setUnresolved(true);
        javaImplementation.setName(reader.getAttributeValue(null, CLASS));
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

                                            composite.getExtensions().add(extension);
                                        }
                                    }
                                } else if (extension instanceof Binding) {
                                    if (extension instanceof PolicySubject) {
                                        ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
                                        bindingType.setType(name);
                                        bindingType.setUnresolved(true);
                                        ((PolicySubject)extension).setExtensionType(bindingType);
                                    }
                                    // <service><binding> and
                                    // <reference><binding>
                                    if (callback != null) {
                                        callback.getBindings().add((Binding)extension);
                                    } else {
                                        if (contract != null) {
                                            contract.getBindings().add((Binding)extension);
                                        } else {
                                            if (name.getNamespaceURI().equals(SCA11_NS)) {
                                                error(monitor, "UnexpectedBindingElement", extension);
                                                //throw new ContributionReadException("Unexpected <binding> element found. It should appear inside a <service> or <reference> element");
                                            } else {
                                                composite.getExtensions().add(extension);
                                            }
                                        }
                                    }

                                } else if (extension instanceof Implementation) {
                                    if (extension instanceof PolicySubject) {
                                        ExtensionType implType =
                                            intentAttachPointTypeFactory.createImplementationType();
                                        implType.setType(name);
                                        implType.setUnresolved(true);
                                        ((PolicySubject)extension).setExtensionType(implType);
                                    }
                                    // <component><implementation>
                                    if (component != null) {
                                        component.setImplementation((Implementation)extension);
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

     * @param source
     * @param target
     * @return
     */
    public boolean isMutuallyCompatible(InterfaceContract source, InterfaceContract target) {
        ExtensionType ext = source.getInterface().getExtensionType();
        InterfaceContract sourceContract = null;
       
        // Are the forward interfaces equal?
        if (isMutuallyCompatible(source.getInterface(), target.getInterface())) {
            // Is there a Callback interface?
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

        return SCABinding.class;
    }

    public SCABinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
        SCABinding scaBinding = scaBindingFactory.createSCABinding();
        ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
        bindingType.setType(getArtifactType());
        bindingType.setUnresolved(true);
        ((PolicySubject)scaBinding).setExtensionType(bindingType);

        // Read policies
        policyProcessor.readPolicies(scaBinding, reader);
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

   
    protected void removeConstrainedIntents(PolicySubject subject, BuilderContext context) {
        List<Intent> intents = subject.getRequiredIntents();
       
        // Remove the intents whose @contrains do not include the current element
        ExtensionType extensionType = subject.getExtensionType();
        if(extensionType != null){
            List<Intent> copy = new ArrayList<Intent>(intents);
            for (Intent i : copy) {
              List<ExtensionType> constrainedTypes = i.getConstrainedTypes();
              if (( constrainedTypes.size() == 0 ) && ( i.getQualifiableIntent() != null ) ) 
                constrainedTypes = i.getQualifiableIntent().getConstrainedTypes();
             
                if (constrainedTypes.size() > 0){
                    boolean constraintFound = false;
                    for (ExtensionType constrainedType : constrainedTypes){
                        if (constrainedType.getType().equals(extensionType.getType()) ||
                            constrainedType.getType().equals(extensionType.getBaseType())){
                            constraintFound = true;
                            break;
                        }
                    }
                    if(!constraintFound){
View Full Code Here

Examples of org.apache.tuscany.sca.policy.ExtensionType

              // warning here.
              if ( subject instanceof EndpointReference ) {
                 warning(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString());
              } else {
                // Need to check the ExtensionType to see if the intent is provided there. If not, throw an error
                ExtensionType type = subject.getExtensionType();

               
                if ( type == null ) {
                  error(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString());
                } else {
                  // The ExtensionType on the subject only has the binding name. The one in the system
                  // definitions will have the mayProvide/alwaysProvides values
                  for ( ExtensionType et : context.getDefinitions().getBindingTypes() ) {
                    if ( type.getType().equals(et.getType()) ) {
                      type = et;
                    }
                  }
               
                  if ( !type.getAlwaysProvidedIntents().contains(intent) && !type.getMayProvidedIntents().contains(intent)) {                               
                    error(context.getMonitor(), "IntentNotSatisfiedAtBuild", subject, intent.getName(), subject.toString());
                  }
                }
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.