summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/tags/java-stable-20060304/sca/container.js/src/samples/java/org/apache/tuscany/container/js/sample/helloworld/Main.java
blob: 2e63a5a21e751c7ae37acd5cc1051869deec1ce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package org.apache.tuscany.container.js.sample.helloworld;

import org.apache.tuscany.core.client.TuscanyRuntime;
import org.osoa.sca.CurrentModuleContext;
import org.osoa.sca.ModuleContext;

public class Main {

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

        TuscanyRuntime tuscany = new TuscanyRuntime("jsHello", null);
        tuscany.start();
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        HelloWorld s = 
            (HelloWorld) moduleContext.locateService("HelloWorldJSComponent");

        String value = s.getGreeting("Petra");

        System.out.println(value);

        tuscany.stop();
    }
    
}