Package org.apache.tuscany.sca.node.launcher

Examples of org.apache.tuscany.sca.node.launcher.NodeLauncher


    public static void main(String[] args) throws Exception {
       
        SCANode2 node = null;
        try {
           
            NodeLauncher nodeLauncher = NodeLauncher.newInstance();
            node = nodeLauncher.createNode("http://localhost:9990/node-image/NodeA");

            node.start();
           
            // get a reference to the calculator component
            SCAClient client = (SCAClient)node;
View Full Code Here


       
        DomainManagerLauncher managerLauncher = DomainManagerLauncher.newInstance();
        domainManager = managerLauncher.createDomainManager(domainDir);
        domainManager.start();
       
        NodeLauncher nodeLauncher = NodeLauncher.newInstance();
        storeSupplierNode = nodeLauncher.createNode("http://localhost:9990/node-config/StoreSupplierNode");
        storeSupplierNode.start();
       
        storeCatalogsNode = nodeLauncher.createNode("http://localhost:9990/node-config/CatalogsNode");
        storeCatalogsNode.start();
       
        storeClientNode = nodeLauncher.createNode("http://localhost:9990/node-config/StoreClientNode");
        storeClientNode.start();
       
    }
View Full Code Here

import client.Shopper;

public class LaunchStoreClientNode {

    public static void main(String[] args) throws Exception {
        NodeLauncher nodeLauncher = NodeLauncher.newInstance();
        SCANode2 storeClientNode = nodeLauncher.createNode("http://localhost:9990/node-config/StoreClientNode");
        storeClientNode.start();
        SCAClient client = (SCAClient)storeClientNode;
       
        Shopper shopper = client.getService(Shopper.class, "StoreClient");
       
View Full Code Here

    public static void main(String[] args) throws Exception {
       
        SCANode2 node = null;
        try {
           
            NodeLauncher nodeLauncher = NodeLauncher.newInstance();
            node = nodeLauncher.createNode("http://localhost:9990/node-config/NodeA");

            node.start();
           
            // get a reference to the calculator component
            SCAClient client = (SCAClient)node;
View Full Code Here

        System.out.println("domain.composite");
        System.out.println(print(domainComposite));
       
        // Now start our SCA nodes
        List<SCANode2> runtimeNodes = new ArrayList<SCANode2>();
        NodeLauncher launcher = NodeLauncher.newInstance();
        for (Component node: cloudComposite.getComponents()) {
           
            // Create a composite containing the components that we want to run
            // on the node
            Composite runnable = assemblyFactory.createComposite();
            runnable.setName(new QName("http://sample", node.getName()));
            NodeImplementation nodeImplementation = (NodeImplementation)node.getImplementation();
            for (Component component: nodeImplementation.getComposite().getComponents()) {
                for (Component configured: domainComposite.getComponents()) {
                    if (configured.getName().equals(component.getName())) {
                        runnable.getComponents().add(configured);
                        break;
                    }
                }
            }

            // Create the SCA node, give it the composite and the list of contributions
            // to use
            List<Contribution> dependencies = nodeDependencies.get(node);
            org.apache.tuscany.sca.node.launcher.NodeLauncher.Contribution[] contributions = new org.apache.tuscany.sca.node.launcher.NodeLauncher.Contribution[dependencies.size()];
            for (int c =0, n = dependencies.size(); c < n; c++) {
                Contribution dependency = dependencies.get(c);
                contributions[c] = new org.apache.tuscany.sca.node.launcher.NodeLauncher.Contribution(dependency.getURI(), dependency.getLocation());
            }
            SCANode2 runtimeNode = launcher.createNode("http://sample/" + node.getName(), print(runnable), contributions);
           
            // Start the node
            runtimeNode.start();
            runtimeNodes.add(runtimeNode);
        }
View Full Code Here

        System.out.println("domain.composite");
        System.out.println(print(domainComposite));
       
        // Now start our SCA nodes
        List<SCANode> runtimeNodes = new ArrayList<SCANode>();
        NodeLauncher launcher = NodeLauncher.newInstance();
        for (Component node: cloudComposite.getComponents()) {
           
            // Create a composite containing the components that we want to run
            // on the node
            Composite runnable = assemblyFactory.createComposite();
            runnable.setName(new QName("http://sample", node.getName()));
            NodeImplementation nodeImplementation = (NodeImplementation)node.getImplementation();
            for (Component component: nodeImplementation.getComposite().getComponents()) {
                for (Component configured: domainComposite.getComponents()) {
                    if (configured.getName().equals(component.getName())) {
                        runnable.getComponents().add(configured);
                        break;
                    }
                }
            }

            // Create the SCA node, give it the composite and the list of contributions
            // to use
            List<Contribution> dependencies = nodeDependencies.get(node);
            org.apache.tuscany.sca.node.launcher.Contribution[] contributions = new org.apache.tuscany.sca.node.launcher.Contribution[dependencies.size()];
            for (int c =0, n = dependencies.size(); c < n; c++) {
                Contribution dependency = dependencies.get(c);
                contributions[c] = new org.apache.tuscany.sca.node.launcher.Contribution(dependency.getURI(), dependency.getLocation());
            }
            SCANode runtimeNode = launcher.createNode("http://sample/" + node.getName(), print(runnable), contributions);
           
            // Start the node
            runtimeNode.start();
            runtimeNodes.add(runtimeNode);
        }
View Full Code Here

        jmsBroker.setPersistent(false);
        jmsBroker.setUseJmx(false);
        jmsBroker.addConnector("tcp://localhost:61619");
        jmsBroker.start();
       
        NodeLauncher launcher = NodeLauncher.newInstance();
        SCANode node = launcher.createNode(null,
                                           new Contribution("assets", "../assets/target/tutorial-assets.jar"),
                                           new Contribution("warehouse", "../warehouse-spring/target/tutorial-warehouse-spring.jar"));
        node.start();
       
        System.out.println("Press a key to stop");
View Full Code Here

        } catch (IOException e) {
            e.printStackTrace();
        }    
       */  
       
        NodeLauncher nodeLauncher = NodeLauncher.newInstance();
        storeSupplierNode = nodeLauncher.createNodeFromURL("http://localhost:9990/node-config/StoreSupplierNode");
        storeSupplierNode.start();
       
        storeCatalogsNode = nodeLauncher.createNodeFromURL("http://localhost:9990/node-config/CatalogsNode");
        storeCatalogsNode.start();
       
        storeClientNode = nodeLauncher.createNodeFromURL("http://localhost:9990/node-config/StoreClientNode");
        storeClientNode.start();
       
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
       
        SCANode node = null;
        try {
           
            NodeLauncher nodeLauncher = NodeLauncher.newInstance();
            node = nodeLauncher.createNodeFromURL("http://localhost:9990/node-config/NodeA");

            node.start();
           
            // get a reference to the calculator component
            SCAClient client = (SCAClient)node;
View Full Code Here

import client.Shopper;

public class LaunchStoreClientNode {

    public static void main(String[] args) throws Exception {
        NodeLauncher nodeLauncher = NodeLauncher.newInstance();
        SCANode storeClientNode = nodeLauncher.createNodeFromURL("http://localhost:9990/node-config/StoreClientNode");
        storeClientNode.start();
        SCAClient client = (SCAClient)storeClientNode;
       
        Shopper shopper = client.getService(Shopper.class, "StoreClient");
       
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.node.launcher.NodeLauncher

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.