Package org.apache.tuscany.sca.node

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


       
        System.out.println("Starting the Sample SCA Spring BigBank server...");
               
        SCANodeFactory factory = SCANodeFactory.newInstance();
        SCANode node = factory.createSCANodeFromClassLoader("BigBank.composite", BigBankServer.class.getClassLoader());
        node.start();

        if (timeout < 0) {
            System.out.println("Press Enter to Exit...");
            System.in.read();
        } else {
View Full Code Here


            jmsBroker.addConnector("tcp://localhost:61619");
            jmsBroker.start();
           
            SCANodeFactory factory = SCANodeFactory.newInstance();
            SCANode node = factory.createSCANodeFromClassLoader("CheckingsAccount.composite", CheckingAccountServer.class.getClassLoader());
            node.start();

            if (timeout < 0) {
                System.out.println("CheckingsAccount server started (press enter to shutdown)");
                System.in.read();
            } else {
View Full Code Here

                .getResource("implementation/policies/CalculatorJass.config").toString());
        }

        SCANodeFactory factory = SCANodeFactory.newInstance();
        SCANode node = factory.createSCANodeFromClassLoader("implementation/policies/Calculator.composite", CalculatorServiceImpl.class.getClassLoader());
        node.start();       
             
        CalculatorService calculatorService =
            ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");

        // Calculate
View Full Code Here

    public void testCalculator() throws Exception {      
       
        SCANode node = SCANodeFactory.newInstance().createSCANodeFromClassLoader("MyService.composite", null);
        try {

            node.start();

            MyService service = ((SCAClient)node).getService(MyService.class, "MyServiceComponent");

            Assert.assertEquals("Hello petra", service.sayHello("petra"));
View Full Code Here

       
        SCANode clientNode = SCANodeFactory.newInstance().createSCANodeFromClassLoader("MyClient.composite", null);
        try {

            serviceNode.start();
            clientNode.start();

            MyService service = ((SCAClient)clientNode).getService(MyService.class, "MyClientComponent");

            Assert.assertEquals("Hi Hello petra", service.sayHello("petra"));
View Full Code Here

    public void atDestroyProper() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        SCANode 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 void atInitProper() throws Exception {
        SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
        SCANode 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 static void main(String[] args) throws Exception {       
       
        SCANodeFactory factory = SCANodeFactory.newInstance();
        SCANode node = factory.createSCANode(new File("src/main/resources/context/imports/Calculator.composite").toURL().toString(),
                new SCAContribution("TestContribution", new File("src/main/resources/context/imports/").toURL().toString()));
        node.start();       
             
        CalculatorService calculatorService =
            ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
       
        System.out.println("3 + 2=" + calculatorService.add(3, 2));
View Full Code Here

    public static void main(String[] args) throws Exception {       
       
        SCANodeFactory factory = SCANodeFactory.newInstance();
        SCANode node = factory.createSCANode(new File("src/main/resources/context/access/Calculator.composite").toURL().toString(),
                new SCAContribution("TestContribution", new File("src/main/resources/context/access/").toURL().toString()));
        node.start();
       
        // Code: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
        if (ctx.containsBean("CalculatorServiceBean"))
            System.out.println("CalculatorServiceBean is now available for use...");
View Full Code Here

        System.out.println("Starting the Sample SCA StockQuote Service...");

        SCANodeFactory factory = SCANodeFactory.newInstance();
        SCANode node = factory.createSCANodeFromClassLoader("context/multiple/StockQuote.composite", StockQuoteServer.class.getClassLoader());
        node.start();
       
        // Method 1: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
        if (ctx.containsBean("StockQuoteServiceBean"))
            System.out.println("StockQuoteServiceBean is now available for use...");       
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.