Package org.apache.tuscany.sca.node

Examples of org.apache.tuscany.sca.node.SCANode2.start()


        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;
            CalculatorService calculatorService =
                client.getService(CalculatorService.class, "CalculatorServiceComponentA");
View Full Code Here


    public void atInitProper() throws Exception {
        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
        SCANode2 node = nodeFactory.createSCANode(new File("src/main/resources/proper/AService.composite").toURL().toString(),
                new SCAContribution("TestContribution",
                                    new File("src/main/resources/proper").toURL().toString()));
        node.start();
        AService aService = ((SCAClient)node).getService(AService.class, "AComponent");
        Assert.assertTrue(aService.isInitProper());
        Assert.assertEquals("Hello Pandu", aService.getGreetings("Pandu"));
        node.stop();
    }
View Full Code Here

    public void atDestroyProper() throws Exception {
        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
        SCANode2 node = nodeFactory.createSCANode(new File("src/main/resources/proper/AService.composite").toURL().toString(),
                new SCAContribution("TestContribution",
                                    new File("src/main/resources/proper").toURL().toString()));
        node.start();
        AService aService = ((SCAClient)node).getService(AService.class, "AComponent");
        Assert.assertEquals("Hello Pandu", aService.getGreetings("Pandu"));
        node.stop();
    }
View Full Code Here

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");
       
        String total = shopper.shop("Orange", 5);
View Full Code Here

        System.out.println("Result: " + result)// callback from the server
    }

    public static void main(String[] args) throws Exception {
        SCANode2 node = SCANode2Factory.newInstance().createSCANodeFromClassLoader("myapp.composite", MyClientImpl.class.getClassLoader());
        node.start();
        run(node);
        System.out.println("Closing the domain");
        node.stop();
    }
View Full Code Here

        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;
            CalculatorService calculatorService =
                client.getService(CalculatorService.class, "CalculatorServiceComponentA");
View Full Code Here

public class CallbackServer {

    public static void main(String[] args) throws Exception {
       
        SCANode2 node = SCANode2Factory.newInstance().createSCANodeFromClassLoader("callbackws.composite", null);
        node.start();

        try {
            System.out.println("Callback server started (press enter to shutdown)");
            System.in.read();
        } catch (IOException e) {
View Full Code Here

                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);
        }
       
        System.out.println("Nodes are running, press enter to stop...");
        System.in.read();
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.