Package org.apache.tuscany.sca.node

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


        node.stop();
    }

    private static void runCarWireElement() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("test-clients/carbookings2-client.composite",
                                                       locate("usingsca"));

        node.start();

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

        node.stop();
    }
View Full Code Here


        node.stop();
    }

    private static void runComplexPropertyElement() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("test-clients/orders1-client.composite",
                                                       locate("usingsca"));

        node.start();

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

        node.stop();
    }
View Full Code Here

        node.stop();
    }

    private static void runComplexPropertyType() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("test-clients/orders2-client.composite",
                                                       locate("usingsca"));

        node.start();

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

        node.stop();
    }
View Full Code Here

        node.stop();
    }

    private static void runCurrencyConverter() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("test-clients/converter-client.composite",
                                                       locate("usingsca"));

        node.start();

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

        node.stop();
    }
View Full Code Here

        node.stop();
    }

    private static void runMultiDomain() throws Exception {
        SCANode hotelsNode =
            SCANodeFactory.newInstance().createSCANode("test-clients/hotelsdomain-client.composite",
                                                       locate("usingsca"));
        SCANode toursNode =
            SCANodeFactory.newInstance().createSCANode("test-clients/toursdomain-client.composite",
                                                       locate("usingsca"));

        hotelsNode.start();
        toursNode.start();

        Runnable hotelsClient = ((SCAClient)hotelsNode).getService(Runnable.class, "HotelsDomainClient");
        hotelsClient.run();
        Runnable toursClient = ((SCAClient)toursNode).getService(Runnable.class, "ToursDomainClient");
        toursClient.run();

        toursNode.stop();
        hotelsNode.stop();
    }
View Full Code Here

        toursNode.stop();
        hotelsNode.stop();
    }

    private static void runTripAutowire() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("test-clients/bookings3-client.composite",
                                                       locate("usingsca"));

        node.start();

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

        node.stop();
    }
View Full Code Here

        node.stop();
    }

    private static void runTripBooking() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("test-clients/bookings1-client.composite",
                                                       locate("usingsca"));

        node.start();

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

        node.stop();
    }
View Full Code Here

        node.stop();
    }

    private static void runTripWireElement() throws Exception {
        SCANode node =
            SCANodeFactory.newInstance().createSCANode("test-clients/bookings2-client.composite",
                                                       locate("usingsca"));

        node.start();

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

        node.stop();
    }
View Full Code Here

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

        SCANode node =
            SCANodeFactory.newInstance().createSCANode("notification-jms.composite",
                                                       notificationContribution,
                                                       notificationJMSContribution);

        try {
            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("Notification sent");
        } finally {
            node.stop();
        }
    }
View Full Code Here

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

public class PolicyLauncher {

    public static void main(String[] args) throws Exception {
        SCANode node1 =
            SCANodeFactory.newInstance().createSCANode(null,
                                                   locate("common"),
                                                       locate("policy-client"),
                                                       locate("payment-java-policy"),
                                                       locate("trip-policy"));

        node1.start();

        SCANode node2 = SCANodeFactory.newInstance().createSCANode(null,
                                                                   locate("creditcard-payment-jaxb-policy"));

        node2.start();

        Runnable client = ((SCAClient)node1).getService(Runnable.class, "TestClient/Runnable");
        client.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.