Package org.apache.tuscany.sca.implementation.jee

Examples of org.apache.tuscany.sca.implementation.jee.JEEImplementation


    }

    public JEEImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.jee> element
        JEEImplementation implementation = implementationFactory.createJEEImplementation();
        implementation.setUnresolved(true);
       
        // Read the archive attribute
        String archive = getString(reader, "archive");
        if (archive != null) {
            implementation.setArchive(archive);

            // Set the URI of the component type
            implementation.setURI(archive);
        }
       
        // the resulting implementation (composite) will be cached by the CompositeModelResolver
        // based on it's name so we need to derive a unique name for this implementation based
        // on the name of the archive that it represents
        String path = URI.create(archive).getPath();
        String localName = "impl-jee-current-dir-archive";
        if (path != null){
            int s = path.lastIndexOf('/');
            if (s > -1){
                localName = path.substring(s + 1);
            } else {
                if (path.length() > 0 && !path.equals(".")){
                    localName = path;
                }  
            }
        }
       
        QName name = new QName(Constants.SCA10_TUSCANY_NS, localName);
        implementation.setName(name);

        // Read policies
        policyProcessor.readPolicies(implementation, reader);

        // Skip to end element
View Full Code Here


        Assert.assertEquals("Deployable composites", 1, deployables.size());
        Composite composite = deployables.get(0);
        Assert.assertEquals("Number of components", 1, composite.getComponents().size());
        Component component = composite.getComponents().get(0);
        Assert.assertTrue("Component with implementation.jee", component.getImplementation() instanceof JEEImplementation);
        JEEImplementation jeeImpl = (JEEImplementation)component.getImplementation();
        Assert.assertEquals("Number of services", 2, jeeImpl.getServices().size());
        Assert.assertEquals("Number of references", 1, jeeImpl.getReferences().size());
    }
View Full Code Here

        Assert.assertEquals("Deployable composites", 1, deployables.size());
        Composite composite = deployables.get(0);
        Assert.assertEquals("Number of components", 1, composite.getComponents().size());
        Component component = composite.getComponents().get(0);
        Assert.assertTrue("Component with implementation.jee", component.getImplementation() instanceof JEEImplementation);
        JEEImplementation jeeImpl = (JEEImplementation)component.getImplementation();
        Assert.assertEquals("Number of services", 2, jeeImpl.getServices().size());
      // TODO - TUSCANY-3008
      //  Assert.assertEquals("Number of references", 1, jeeImpl.getReferences().size());
    }
View Full Code Here

        Assert.assertEquals("Deployable composites", 1, deployables.size());
        Composite composite = deployables.get(0);
        Assert.assertEquals("Number of components", 1, composite.getComponents().size());
        Component component = composite.getComponents().get(0);
        Assert.assertTrue("Component with implementation.jee", component.getImplementation() instanceof JEEImplementation);
        JEEImplementation jeeImpl = (JEEImplementation)component.getImplementation();
        Assert.assertEquals("Number of services", 2, jeeImpl.getServices().size());
        Assert.assertEquals("Number of references", 1, jeeImpl.getReferences().size());
    }
View Full Code Here

        Assert.assertEquals("Deployable composites", 1, deployables.size());
        Composite composite = deployables.get(0);
        Assert.assertEquals("Number of components", 1, composite.getComponents().size());
        Component component = composite.getComponents().get(0);
        Assert.assertTrue("Component with implementation.jee", component.getImplementation() instanceof JEEImplementation);
        JEEImplementation jeeImpl = (JEEImplementation)component.getImplementation();
        Assert.assertEquals("Number of services", 2, jeeImpl.getServices().size());
      // TODO - TUSCANY-3008
      //  Assert.assertEquals("Number of references", 1, jeeImpl.getReferences().size());
    }
View Full Code Here

    }

    public JEEImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.jee> element
        JEEImplementation implementation = implementationFactory.createJEEImplementation();
        implementation.setUnresolved(true);

        // Read the archive attribute
        String archive = getString(reader, "archive");
        if (archive != null) {
            implementation.setArchive(archive);

            // Set the URI of the component type
            implementation.setURI(archive);
        }

        // Skip to end element
        while (reader.hasNext()) {
            if (reader.next() == END_ELEMENT && IMPLEMENTATION_JEE.equals(reader.getName())) {
View Full Code Here

    }

    public JEEImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.jee> element
        JEEImplementation implementation = implementationFactory.createJEEImplementation();
        implementation.setUnresolved(true);

        // Read the archive attribute
        String archive = getString(reader, "archive");
        if (archive != null) {
            implementation.setArchive(archive);

            // Set the URI of the component type
            implementation.setURI(archive);
        }

        // Skip to end element
        while (reader.hasNext()) {
            if (reader.next() == END_ELEMENT && IMPLEMENTATION_JEE.equals(reader.getName())) {
View Full Code Here

    }

    public JEEImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.jee> element
        JEEImplementation implementation = implementationFactory.createJEEImplementation();
        implementation.setUnresolved(true);
       
        implementation.setName(IMPLEMENTATION_JEE);

        // Read the archive attribute
        String archive = getString(reader, "archive");
        if (archive != null) {
            implementation.setArchive(archive);

            // Set the URI of the component type
            implementation.setURI(archive);
        }

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

    }

    public JEEImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.jee> element
        JEEImplementation implementation = implementationFactory.createJEEImplementation();
        implementation.setUnresolved(true);
       
        // Read the archive attribute
        String archive = getString(reader, "archive");
        if (archive != null) {
            implementation.setArchive(archive);

            // Set the URI of the component type
            implementation.setURI(archive);
        }
       
        // the resulting implementation (composite) will be cached by the CompositeModelResolver
        // based on it's name so we need to derive a unique name for this implementation based
        // on the name of the archive that it represents
        String path = URI.create(archive).getPath();
        String localName = "impl-jee-current-dir-archive";
        if (path != null){
            int s = path.lastIndexOf('/');
            if (s > -1){
                localName = path.substring(s + 1);
            } else {
                if (path.length() > 0 && !path.equals(".")){
                    localName = path;
                }  
            }
        }
       
        QName name = new QName(Constants.SCA10_TUSCANY_NS, localName);
        implementation.setName(name);

        // Read policies
        policyProcessor.readPolicies(implementation, reader);

        // Skip to end element
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.jee.JEEImplementation

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.