Package org.apache.tuscany.sca.assembly

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


     * @return
     */
    protected ConstrainingType readConstrainingType(XMLStreamReader reader) {
        QName constrainingTypeName = getQName(reader, Constants.CONSTRAINING_TYPE);
        if (constrainingTypeName != null) {
            ConstrainingType constrainingType = assemblyFactory.createConstrainingType();
            constrainingType.setName(constrainingTypeName);
            constrainingType.setUnresolved(true);
            return constrainingType;
        } else {
            return null;
        }
    }
View Full Code Here


     * Returns a constrainingType attribute.
     * @param componentType
     * @return
     */
    protected XAttr writeConstrainingType(ComponentType componentType) {
        ConstrainingType constrainingType = componentType.getConstrainingType();
        if (constrainingType != null)
            return new XAttr(Constants.CONSTRAINING_TYPE, constrainingType.getName());
        else
            return null;
    }
View Full Code Here

            urlStream = url.openStream();
            XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
            reader.nextTag();
           
            // Read the constrainingType model
            ConstrainingType constrainingType = (ConstrainingType)extensionProcessor.read(reader);

            // For debugging purposes, write it back to XML
//            if (constrainingType != null) {
//                try {
//                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
View Full Code Here

    }

    public void resolve(Composite composite, ModelResolver resolver) throws ContributionResolveException {

        // Resolve constraining type
        ConstrainingType constrainingType = composite.getConstrainingType();
        if (constrainingType != null) {
            constrainingType = resolver.resolveModel(ConstrainingType.class, constrainingType);
            composite.setConstrainingType(constrainingType);
        }
View Full Code Here

    public void testReadConstrainingType() throws Exception {
        ConstrainingTypeProcessor constrainingTypeProcessor = new ConstrainingTypeProcessor(assemblyFactory, policyFactory, staxProcessor);
        InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        ConstrainingType constrainingType = constrainingTypeProcessor.read(reader);
        assertNotNull(constrainingType);

        //new PrintUtil(System.out).print(constrainingType);
    }
View Full Code Here

     * @return
     */
    protected ConstrainingType readConstrainingType(XMLStreamReader reader) {
        QName constrainingTypeName = getQName(reader, Constants.CONSTRAINING_TYPE);
        if (constrainingTypeName != null) {
            ConstrainingType constrainingType = assemblyFactory.createConstrainingType();
            constrainingType.setName(constrainingTypeName);
            constrainingType.setUnresolved(true);
            return constrainingType;
        } else {
            return null;
        }
    }
View Full Code Here

     * Returns a constrainingType attribute.
     * @param componentType
     * @return
     */
    protected XAttr writeConstrainingType(ComponentType componentType) {
        ConstrainingType constrainingType = componentType.getConstrainingType();
        if (constrainingType != null)
            return new XAttr(Constants.CONSTRAINING_TYPE, constrainingType.getName());
        else
            return null;
    }
View Full Code Here

    }

    public void resolve(Composite composite, ModelResolver resolver) throws ContributionResolveException {

        // Resolve constraining type
        ConstrainingType constrainingType = composite.getConstrainingType();
        if (constrainingType != null) {
            constrainingType = resolver.resolveModel(ConstrainingType.class, constrainingType);
            composite.setConstrainingType(constrainingType);
        }
View Full Code Here

       
    public void testResolveConstrainingType() throws Exception {
       
        URL url = getClass().getResource("CalculatorComponent.constrainingType");
        URI uri = URI.create("CalculatorComponent.constrainingType");
        ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
        assertNotNull(constrainingType);
        resolver.addModel(constrainingType);

        url = getClass().getResource("TestAllCalculator.composite");
        uri = URI.create("TestAllCalculator.constrainingType");
View Full Code Here

    public ConstrainingTypeModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
        this.contribution = contribution;
    }

    public void addModel(Object resolved) {
        ConstrainingType composite = (ConstrainingType)resolved;
        map.put(composite.getName(), composite);
    }
View Full Code Here

TOP

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

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.