summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-integration/samples/sca/composite-impl/src/main/java/composite/CompositeClient.java
blob: 7543b68a29d1b7a7019a864e28be6a45d70289bc (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
26
package composite;

import org.apache.tuscany.api.SCARuntime;
import org.osoa.sca.CompositeContext;
import org.osoa.sca.CurrentCompositeContext;

/**
 * Simple client program that invokes the components that we wired together.
 *
 * @version $Rev$ $Date$
 */
public class CompositeClient {

    public static void main(String[] args) throws Exception {
    	SCARuntime.start("OuterComposite.composite");
    	
        CompositeContext context = CurrentCompositeContext.getContext();

        Source source = context.locateService(Source.class, "SourceComponent/InnerSourceService");
        System.out.println("Main thread " + Thread.currentThread());
        source.clientMethod("Client.main");
        Thread.sleep(500);
        
        SCARuntime.stop();
    }
}