Package org.apache.tuscany.sca.implementation.node

Examples of org.apache.tuscany.sca.implementation.node.NodeImplementation


     * @return
     */
    private static String relatedLink(Composite composite) {
        for (Component component: composite.getComponents()) {
            if (component.getImplementation() instanceof NodeImplementation) {
                NodeImplementation nodeImplementation = (NodeImplementation)component.getImplementation();
                Composite deployable = nodeImplementation.getComposite();
                String contributionURI = deployable.getURI();
                QName qname = deployable.getName();
                String key = compositeKey(contributionURI, qname);
                return "/composite-source/" + key;
            }
View Full Code Here


    }

    public NodeImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
       
        // Read an <implementation.node> element
        NodeImplementation implementation = implementationFactory.createNodeImplementation();
        implementation.setUnresolved(false);

        // Read the composite attribute
        QName qname = getQName(reader, "composite");
        if (qname != null) {
            Composite composite = assemblyFactory.createComposite();
            composite.setName(qname);
            String uri = getString(reader, "uri");
            composite.setURI(uri);
            composite.setUnresolved(true);
            implementation.setComposite(composite);
        }

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

        for (Component component: composite.getComponents()) {
            Implementation implementation = component.getImplementation();
            if (implementation instanceof NodeImplementation) {
               
                // Get the application composite assigned to the node
                NodeImplementation nodeImplementation = (NodeImplementation)implementation;
                Composite applicationComposite = nodeImplementation.getComposite();
               
                // Get the default bindings configured on the node
                List<Binding> defaultBindings = new ArrayList<Binding>();
                for (ComponentService componentService: component.getServices()) {
                    defaultBindings.addAll(componentService.getBindings());
View Full Code Here

            // bindings that it configures
            Component nodeComponent = null;
            QName nodeCompositeName = null;
            for (Composite cloudComposite : cloudsComposite.getIncludes()) {
                for (Component nc : cloudComposite.getComponents()) {
                    NodeImplementation nodeImplementation = (NodeImplementation)nc.getImplementation();
                    if (nodeImplementation.getComposite().getName().equals(compositeName) &&
                        nodeImplementation.getComposite().getURI().equals(contributionURI)) {
                        nodeImplementation.setComposite(composite);
                        nodeComponent = nc;
                        nodeCompositeName = cloudComposite.getName();
                        break;
                    }
                }
View Full Code Here

   * @return
   */
  private static String relatedLink(Composite composite) {
    for (Component component : composite.getComponents()) {
      if (component.getImplementation() instanceof NodeImplementation) {
        NodeImplementation nodeImplementation = (NodeImplementation) component
            .getImplementation();
        Composite deployable = nodeImplementation.getComposite();
        String contributionURI = deployable.getURI();
        QName qname = deployable.getName();
        String key = compositeKey(contributionURI, qname);
        return "/composite-source/" + key;
      }
View Full Code Here

     * @return
     */
    private Composite nodeComposite(Composite composite) {
        Composite nodeComposite = assemblyFactory.createComposite();
        Component nodeComponent = assemblyFactory.createComponent();
        NodeImplementation nodeImplementation = nodeImplementationFactory.createNodeImplementation();
        nodeImplementation.setComposite(composite);
        nodeComponent.setImplementation(nodeImplementation);
        ComponentService nodeService = assemblyFactory.createComponentService();
        nodeService.getBindings().addAll(defaultBindings);
        nodeComponent.getServices().add(nodeService);
        nodeComposite.getComponents().add(nodeComponent);
View Full Code Here

     * @return
     */
    private Composite nodeComposite(Composite composite) {
        Composite nodeComposite = assemblyFactory.createComposite();
        Component nodeComponent = assemblyFactory.createComponent();
        NodeImplementation nodeImplementation = nodeImplementationFactory.createNodeImplementation();
        nodeImplementation.setComposite(composite);
        nodeComponent.setImplementation(nodeImplementation);
        ComponentService nodeService = assemblyFactory.createComponentService();
        nodeService.getBindings().addAll(defaultBindings);
        nodeComponent.getServices().add(nodeService);
        nodeComposite.getComponents().add(nodeComponent);
View Full Code Here

            // bindings that it configures
            Component nodeComponent = null;
            QName nodeCompositeName = null;
            for (Composite cloudComposite : cloudsComposite.getIncludes()) {
                for (Component nc : cloudComposite.getComponents()) {
                    NodeImplementation nodeImplementation = (NodeImplementation)nc.getImplementation();
                    if (nodeImplementation.getComposite().getName().equals(compositeName) &&
                        nodeImplementation.getComposite().getURI().equals(contributionURI)) {
                        nodeImplementation.setComposite(composite);
                        nodeComponent = nc;
                        nodeCompositeName = cloudComposite.getName();
                        break;
                    }
                }
View Full Code Here

     * @return
     */
    private static String relatedLink(Composite composite) {
        for (Component component: composite.getComponents()) {
            if (component.getImplementation() instanceof NodeImplementation) {
                NodeImplementation nodeImplementation = (NodeImplementation)component.getImplementation();
                Composite deployable = nodeImplementation.getComposite();
                String contributionURI = deployable.getURI();
                QName qname = deployable.getName();
                String key = compositeKey(contributionURI, qname);
                return "/composite-source/" + key;
            }
View Full Code Here

            binding.setURI("http://localhost:" + (8100 + i));
            nodeService.getBindings().add(binding);
            node.getServices().add(nodeService);

            // Assign a deployable to the node
            NodeImplementation nodeImplementation = nodeFactory.createNodeImplementation();
            Composite deployable = workspace.getDeployables().get(i);
            nodeImplementation.setComposite(deployable);
            node.setImplementation(nodeImplementation);
        }
       
        // Print the model describing the nodes that we just built
        System.out.println("cloud.composite");
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.node.NodeImplementation

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.