Package org.apache.tuscany.sca.node

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


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


     
        Node node1 = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-rmi/calculator-service-contribution/target/sample-binding-rmi-calculator-service-contribution.jar"));      
        Node node2 = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-rmi/calculator-reference-contribution/target/sample-binding-rmi-calculator-reference-contribution.jar"));
       
        node1.start();
        node2.start();
       
        CalculatorService calculator = node2.getService(CalculatorService.class, "CalculatorServiceComponent");

        double result = calculator.add(3, 2);
        System.out.println("3 + 2 = " + result);
View Full Code Here

    public void testComet() {
        JettyServer.portDefault = 8085;
        try {
            final String location = ContributionLocationHelper.getContributionLocation("test.composite");
            final Node node = NodeFactory.newInstance().createNode("test.composite", new Contribution("c1", location));
            node.start();
            // System.out.println("Press any key to stop the node.");
            // System.in.read();
            node.stop();
        } catch (final Exception e) {
            e.printStackTrace();
View Full Code Here

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

        String contextPath = initContextPath(servletContext);
        String contributionRoot = getContributionRoot(servletContext);
        NodeFactory factory = NodeFactory.newInstance();
        String webComposite = getWebComposite(servletContext);
        Node node = factory.createNode(contextPath, webComposite, new Contribution(contributionRoot, contributionRoot));
        node.start();
        return node;
    }
   
    private static String getWebComposite(ServletContext servletContext) {
        InputStream stream = servletContext.getResourceAsStream("/WEB-INF/web.composite");
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", "../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);
View Full Code Here

    public void testInvokeReference() throws Exception {
        Node node = null;

        String contribution = ContributionLocationHelper.getContributionLocation(JSONRPCReferenceTestCase.class);
        node = NodeFactory.newInstance().createNode("JSONRPCReference.composite", new Contribution("testClient", contribution));
        node.start();

        Echo echoComponent = node.getService(Echo.class,"EchoComponentWithReference");
        String result = echoComponent.echo("ABC");
        Assert.assertEquals("echo: ABC", result);
        if (node != null) {
View Full Code Here

    public void testInvokeReferenceVoidOperation() throws Exception {
        Node node = null;

        String contribution = ContributionLocationHelper.getContributionLocation(JSONRPCReferenceTestCase.class);
        node = NodeFactory.newInstance().createNode("JSONRPCReference.composite", new Contribution("testClient", contribution));
        node.start();

        Echo echoComponent = node.getService(Echo.class,"EchoComponentWithReference");
        echoComponent.echoVoid();

        if (node != null) {
View Full Code Here

    @Test
    public void testSync() {
        try {
            Node node = NodeFactory.newInstance().createNode("sync.composite");
            node.start();
            node.stop();
        } catch (final Exception e) {
            Assert.fail(e.getMessage());
        }
    }
View Full Code Here

    @Test
    public void testAsync() {
        try {
            Node node = NodeFactory.newInstance().createNode("async.composite");
            node.start();
            node.stop();
        } catch (final Exception e) {
            Assert.fail(e.getMessage());
        }
    }
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.