Package org.apache.tuscany.sca.node

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


        Node node = factory.createNode(configuration).start();
        return node;
    }

    public static void stop(ServletContext servletContext) {
        Node node = (Node)servletContext.getAttribute(SCA_NODE_ATTRIBUTE);
        if (node != null) {
            node.stop();
            servletContext.setAttribute(SCA_NODE_ATTRIBUTE, null);
        }
    }
View Full Code Here


public class Consumer {

    public static void main(String[] args) throws Exception {

        String contribution = ContributionLocationHelper.getContributionLocation(Consumer.class);
        Node node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/atom/Consumer.composite",new Contribution("c1", contribution));

        CustomerClient testService = node.getService(CustomerClient.class, "CustomerClient");
        testService.testCustomerCollection();

        node.stop();
    }
View Full Code Here

    /*
     * Using the Tuscany Node API to load a contribution.
     * Using the Tuscany Node API to get a local service proxy
     */
    public void launchBindingWSCalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
        double result = calculator.add(3, 2);
        System.out.println("3 + 2 = " + result);
        if (result != 5.0){
            throw new SampleLauncherException();
        }
       
        node.stop();
    }
View Full Code Here

        JSELauncherImplementationJavaCalculator launcher = new JSELauncherImplementationJavaCalculator();
        launcher.launchImplementationJavaCalculator();        
    }
   
    public void launchImplementationJavaCalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-java/calculator-contribution/target/sample-implementation-java-calculator-contribution.jar"));
        node.start();
       
        node.stop();
    }
View Full Code Here

    /*
     * Using the Tuscany Node API to load a contribution.
     * Using the Tuscany Node API to get a local service proxy
     */
    public void launchBindingSCACalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-jsonrpc/calculator-contribution/target/sample-binding-jsonrpc-calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
        double result = calculator.add(3, 2);
        System.out.println("3 + 2 = " + result);
        if (result != 5.0){
            throw new SampleLauncherException();
        }
       
        node.stop();
    }
View Full Code Here

    /*
     * Using the Tuscany Node API to load a contribution.
     * Using the Tuscany Node API to get a local service proxy
     */
    public void launchBindingSCACalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
        double result = calculator.add(3, 2);
        System.out.println("3 + 2 = " + result);
        if (result != 5.0){
            throw new SampleLauncherException();
        }
       
        node.stop();
    }
View Full Code Here

    /*
     * Using the Tuscany Node API to load a contribution.
     * Using the Tuscany Node API to get a local service proxy
     */
    public void launchImplementationScriptCalculator(){
        Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-script/calculator-contribution/target/sample-implementation-script-calculator-contribution.jar"));
        node.start();
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
       
        // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
        double result = calculator.add(3, 2);
        System.out.println("3 + 2 = " + result);
        if (result != 5.0){
            throw new SampleLauncherException();
        }
       
        node.stop();
    }
View Full Code Here

    /**
     * The contribution-binding-sca-calculator contribution includes a client component
     * that calls the CalculatorServiceComponent from an operation marked by @Init.
     */
    public void launchBindingSCACalculator(){
        Node node = startNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar"));
       
        stopNode(node);
    }   
View Full Code Here

   
    /*
     * Using a Tuscany specific mechanism for getting at local service proxies
     */
    public void launchBindingWSCalculator() throws NoSuchDomainException, NoSuchServiceException{
        Node node = startNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar"));
       
        CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
              
        double result = calculator.add(3, 2);
        System.out.println("3 + 2 = " + result);
        if (result != 5.0){
            throw new SampleLauncherException();
View Full Code Here

   
    public static void main(String[] args) throws Exception {
        SampleOSGILauncherBindingSCA launcher = new SampleOSGILauncherBindingSCA();
       
        Node node = launcher.startNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar"));
        launcher.stopNode(node);
    }
View Full Code Here

TOP

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

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.