Package org.apache.tuscany.sca.node

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


    public static void main(String[] args) throws Exception {       
       
      NodeFactory factory = NodeFactory.newInstance();
        Node node = factory.createNode(new File("src/main/resources/context/access/ContextAccess.composite").toURI().toURL().toString(),
                new Contribution("TestContribution", new File("src/main/resources/context/access/").toURI().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


    public static void main(String[] args) throws Exception {       
       
      NodeFactory factory = NodeFactory.newInstance();
        Node node = factory.createNode(new File("src/main/resources/context/imports/ContextImports.composite").toURI().toURL().toString(),
                new Contribution("TestContribution", new File("src/main/resources/context/imports/").toURI().toURL().toString()));
        node.start();
             
        CalculatorService calculatorService =
            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 {

      NodeFactory factory = NodeFactory.newInstance();
        Node node = factory.createNode(new File("src/main/resources/context/multiple/MultipleContext.composite").toURI().toURL().toString(),
                new Contribution("TestContribution", new File("src/main/resources/context/multiple/").toURI().toURL().toString()));
        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

    public void testOneFactoryTwoNodes() {
        NodeFactory factory1 = NodeFactory.getInstance();
        Node node1 = createClientNode(factory1);
        Node node2 = createServiceNode(factory1);
        node1.start();
        node2.start();
        try {
            runClient(node1);
        } finally {
            node2.stop();
            node1.stop();
View Full Code Here

        NodeFactory factory1 = NodeFactory.newInstance();
        Node node1 = createClientNode(factory1);
        NodeFactory factory2 = NodeFactory.newInstance();
        Node node2 = createServiceNode(factory2);
        node1.start();
        node2.start();
        Thread.sleep(1000);
        try {
            // This call doesn't require the Local service, it should be successful
            createCustomer(node1);
            try {
View Full Code Here

        NodeConfiguration config1 =
            factory.createNodeConfiguration().setDomainURI(DOMAIN_URI).setURI("node1").addContribution("c1", ROOT)
                .addDeploymentComposite("c1", CLIENT).addDeploymentComposite("c1", SERVICE);

        Node node1 = factory.createNode(config1);
        node1.start();
        try {
            runClient(node1);
        } finally {
            node1.stop();
            factory.destroy();
View Full Code Here

        }

        NodeFactory factory = NodeFactory.newInstance();
        Node node = factory.createNode(new File("src/main/resources/implementation/policies/ImplementationPolicies.composite").toURI().toURL().toString(),
                new Contribution("TestContribution", new File("src/main/resources/implementation/policies/").toURI().toURL().toString()));
        node.start();
             
        CalculatorService calculatorService =
            node.getService(CalculatorService.class, "CalculatorServiceComponent");

        // Calculate
View Full Code Here

            return;
        }
        try {
            NodeConfiguration configuration = factory.getConfiguration(bundle, null);
            Node node = factory.createNode(configuration);
            node.start();
        } catch (Throwable e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
        }
    }
View Full Code Here

   

    @Test
    public void testCalculatorContribution() throws Exception {
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        double result = calculator.add(3, 2);
       
View Full Code Here

     *    - stop the node
     */
    public static void main(String[] args) throws Exception {
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../calculator-contribution.jar"));
       
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        double result = calculator.add(3, 2);
       
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.