Package org.apache.tuscany.sca.node

Examples of org.apache.tuscany.sca.node.SCANode


        node.stop();
    }

    private static void runAppl() throws Exception {
        SCANode node1 =
            SCANodeFactory.newInstance().createSCANode("tours-appl.composite",
                                                       locate("introducing-trips"),
                                                       locate("buildingblocks"));

        SCANode node2 =
            SCANodeFactory.newInstance().createSCANode("tours-appl-client.composite",
                                                       locate("buildingblocks-client"));

        node1.start();
        node2.start();

        Runnable client = ((SCAClient)node2).getService(Runnable.class, "ApplClient/Runnable");
        client.run();

        node2.stop();
        node1.stop();
    }
View Full Code Here


import org.apache.tuscany.sca.node.SCANodeFactory;

public class IntroducingClientLauncher {

    public static void main(String[] args) throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ClientNode");
        node.start();

        Runnable client = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable");
        client.run();

        node.stop();
    }
View Full Code Here

import org.apache.tuscany.sca.node.SCANodeFactory;

public class IntroducingLauncher {

    public static void main(String[] args) throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode(null,
                                                       locate("introducing-tours"),
                                                       locate("introducing-trips"),
                                                       locate("introducing-client"));

        node.start();

        Runnable proxy = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable");
        proxy.run();

        node.stop();
    }
View Full Code Here

public class IntroducingDomainLauncher {

    public static void main(String[] args) throws Exception {
        String rootDir = "../domainconfig/introducing";
        DomainManagerLauncherBootstrap bootstrap = new DomainManagerLauncherBootstrap(rootDir);
        SCANode node = bootstrap.getNode();
        node.start();

        System.out.println("Domain manager started - Press enter to shutdown.");
        try {
            System.in.read();
        } catch (IOException e) {
        }

        node.stop();
    }
View Full Code Here

* (among other things) the TUSCANY_HOME environment variable.
*/
public class IntroducingToursLauncher {

    public static void main(String[] args) throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ToursNode");
        node.start();

        System.out.println("Node started - Press enter to shutdown.");
        try {
            System.in.read();
        } catch (IOException e) {
        }

        node.stop();
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
        SCAContribution currencyWSContribution = locate("currency-ws");
        SCAContribution currencyContribution = locate("currency");

        SCANode node =
            SCANodeFactory.newInstance().createSCANode("currency-converter-ws.composite",
                                                       currencyContribution,
                                                       currencyWSContribution);
        node.start();

        System.out.println("Quick currency converter test");
        CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter");
        System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP"));
        System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP");

        System.out.println("Node started - Press enter to shutdown.");
        System.in.read();

        node.stop();
    }
View Full Code Here

import org.apache.tuscany.sca.node.SCANodeFactory;

public class FullAppNodesLauncher {

    public static void main(String[] args) throws Exception {
        SCANode nodeCreditcard =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/creditcard");
        nodeCreditcard.start();

        SCANode nodePayment =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/payment");
        nodePayment.start();

        SCANode nodeShoppingcart =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/shoppingcart");
        nodeShoppingcart.start();

        SCANode nodeCurrency =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/currency");
        nodeCurrency.start();

        SCANode nodePackagedtrip =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/packagedtrip");
        nodePackagedtrip.start();

        SCANode nodeBespoketrip =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/bespoketrip");
        nodeBespoketrip.start();

        SCANode nodeFrontend =
            SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/coordination");
        nodeFrontend.start();

        SCANode nodeUI = SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ui");
        nodeUI.start();

        System.out.println("Point your browser at - http://localhost:8080/scatours/ ");
        System.out.println("Nodes started - Press enter to shutdown.");

        try {
            System.in.read();
        } catch (IOException e) {
        }

        nodeCreditcard.stop();
        nodePayment.stop();
        nodeShoppingcart.stop();
        nodeCurrency.stop();
        nodePackagedtrip.stop();
        nodeBespoketrip.stop();
        nodeFrontend.stop();
        nodeUI.stop();
    }
View Full Code Here

public class BlogFeedLauncher {

    public static void main(String[] args) throws Exception {
        SCAContribution feedContribution = locate("blog-feed");

        SCANode node = SCANodeFactory.newInstance().createSCANode("blog-feed.composite", feedContribution);
        node.start();

        System.out.println("Node started - Press enter to shutdown.");
        System.out.println();
        System.out.println("To view the blog feed, use your Web browser to view:");
        System.out.println("  Feeds using Tuscany Data APIs");
        System.out.println("    http://localhost:8090/BlogAtom");
        System.out.println("    http://localhost:8090/BlogRSS");
        System.out.println("  Feeds using Atom APIs");
        System.out.println("    http://localhost:8090/BlogAtomAPIs");
        System.out.println("  Feeds using RSS APIs");
        System.out.println("    http://localhost:8090/BlogRSSAPIs");
        System.out.println();
        System.in.read();
        node.stop();
    }
View Full Code Here

    public static void main(String[] args) throws Exception {
        SCAContribution notificationContribution = locate("notification");
        SCAContribution notificationCORBAContribution = locate("notification-corba");

        SCANode node =
            SCANodeFactory.newInstance().createSCANode("notification-corba.composite",
                                                       notificationContribution,
                                                       notificationCORBAContribution);
        node.start();

        System.out.println("Quick notification test");
        Notification notification = ((SCAClient)node).getService(Notification.class, "Notification");
        String accountID = "1234";
        String subject = "Holiday payment taken";
        String message = "Payment of £102.37 accepted...";
        notification.notify(accountID, subject, message);

        System.out.println("Node started - Press enter to shutdown.");
        System.in.read();
        node.stop();
    }
View Full Code Here

import org.apache.tuscany.sca.node.SCANodeFactory;

public class InteractionLauncher {

    public static void main(String[] args) throws Exception {
        SCANode node1 =
            SCANodeFactory.newInstance().createSCANode("client.composite",
                                                       locate("common"),
                                                       locate("currency"),
                                                       locate("calendar"),
                                                       locate("shoppingcart"),
                                                       locate("interaction-client"));

        SCANode node2 =
            SCANodeFactory.newInstance().createSCANode("service.composite",
                                                       locate("common"),
                                                       locate("hotel"),
                                                       locate("flight"),
                                                       locate("interaction-service-remote"));

        node2.start();
        node1.start();

        Runnable localInteraction = ((SCAClient)node1).getService(Runnable.class, "InteractionLocalClient/Runnable");
        localInteraction.run();

        Runnable remoteInteraction = ((SCAClient)node1).getService(Runnable.class, "InteractionRemoteClient/Runnable");
        remoteInteraction.run();

        Runnable requestResponseInteraction =
            ((SCAClient)node1).getService(Runnable.class, "InteractionRequestResponseClient/Runnable");
        requestResponseInteraction.run();

        Runnable onewayCallbackInteraction =
            ((SCAClient)node1).getService(Runnable.class, "InteractionOneWayCallbackClient/Runnable");
        onewayCallbackInteraction.run();

        Runnable conversationalInteraction =
            ((SCAClient)node1).getService(Runnable.class, "InteractionConversationClient/Runnable");
        conversationalInteraction.run();

        node1.stop();
        node2.stop();
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.node.SCANode

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.