Package org.apache.tuscany.sca.node

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


import com.tuscanyscatours.payment.Payment;

public class PaymentLauncher {

    public static void main(String[] args) throws Exception {
        SCANode node = SCANodeFactory.newInstance().createSCANode(null,
                                                                  locate("payment-bpel-process"),
                                                              locate("payment-bpel"),
                                                              locate("creditcard-payment-jaxb"),
                                                              locate("emailgateway"));
        node.start();
       
        SCAClient client = (SCAClient)node;
        Payment payment = client.getService(Payment.class, "Payment/paymentPartnerLink");

        System.out.println("Payment BPEL test");
        System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f));
        System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f));
       
        node.stop();

        // The following line is a workaround for TUSCANY-3475 when running
        // on Tuscany SCA 1.6 (the JVM waits for 60 seconds before exiting).
        System.exit(0);
    }
View Full Code Here


public class FullAppDomainLauncher {

    public static void main(String[] args) throws Exception {
        String rootDir = "../domainconfig/fullapp";
        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

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

        SCANode node =
            SCANodeFactory.newInstance().createSCANode("notification-ws.composite",
                                                       notificationContribution,
                                                       notificationWSContribution);
        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

public class HelpPagesLauncher {

    public static void main(String[] args) throws Exception {
        SCAContribution helpContribution = locate("help-pages");

        SCANode node = SCANodeFactory.newInstance().createSCANode("help-pages.composite", helpContribution);
        node.start();

        System.out.println("Node started - Press enter to shutdown.");
        System.out.println();
        System.out.println("To view the help pages, use your Web browser to view:");
        System.out.println("    http://localhost:8085/help/index.html");
        System.out.println();
        System.in.read();
        node.stop();
    }
View Full Code Here

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

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

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

        node.stop();
    }
View Full Code Here

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

public class FullAppLauncher {

    public static void main(String[] args) throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode(null,
                                                       locate("common"),
                                                       locate("currency"),
                                                       locate("hotel"),
                                                       locate("flight"),
                                                       locate("car"),
                                                       locate("trip"),
                                                       locate("tripbooking"),
                                                       locate("travelcatalog"),
                                                       //locate("payment-java-policy"),
                                                       locate("payment-spring-policy"),
                                                       locate("creditcard-payment-jaxb-policy"),
                                                       locate("shoppingcart"),
                                                       locate("scatours"),
                                                       locate("fullapp-ui"),
                                                       locate("fullapp-coordination"),
                                                       locate("fullapp-currency"),
                                                       locate("fullapp-packagedtrip"),
                                                       locate("fullapp-bespoketrip"),
                                                       locate("fullapp-shoppingcart"));

        node.start();

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

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

        node.stop();
    }
View Full Code Here

        runImplInclude();
        runAppl();
    }

    private static void runImpl() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("tours-impl-client.composite",
                                                       locate("buildingblocks"),
                                                       locate("buildingblocks-client"));

        node.start();

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

        node.stop();
    }
View Full Code Here

import com.tuscanyscatours.payment.Payment;

public class PaymentLauncher {

    public static void main(String[] args) throws Exception {
        SCANode node = SCANodeFactory.newInstance().createSCANode(null,
                                                              locate("payment-java-policy"),
                                                              locate("creditcard-payment-jaxb-policy"));
        node.start();
       
        SCAClient client = (SCAClient)node;
        Payment payment = client.getService(Payment.class, "Payment");

        System.out.println("Payment Java Policy test");
        System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f));
        System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f));
       
        node.stop();
    }
View Full Code Here

        node.stop();
    }

    private static void runImplInclude() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("tours-impl-include-client.composite",
                                                       locate("introducing-trips"),
                                                       locate("buildingblocks"),
                                                       locate("buildingblocks-client"));

        node.start();

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

        node.stop();
    }
View Full Code Here

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

        SCANode node =
            SCANodeFactory.newInstance().createSCANode("notification-rmi.composite",
                                                       notificationContribution,
                                                       notificationRMIContribution);
        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

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.