Package org.osoa.sca

Examples of org.osoa.sca.CompositeContext.locateService()


    protected void setUp() throws Exception {
        setApplicationSCDL(Source.class, "META-INF/sca/default.scdl");
        super.setUp();

        CompositeContext context = CurrentCompositeContext.getContext();
        source = context.locateService(Source.class, "SourceComponent");
    }

    public void test() throws Exception {
        try {
            System.out.println("Main thread " + Thread.currentThread());
View Full Code Here


public class SimpleCallbackClient {

    public static void main(String[] args) throws Exception {
        // Locate the MyClient component and invoke it
        CompositeContext context = CurrentCompositeContext.getContext();
        MyClient myClient = context.locateService(MyClient.class, "MyClientComponent");
        System.out.println("Main thread " + Thread.currentThread());
        myClient.aClientMethod();
        Thread.sleep(500);
    }
}
View Full Code Here

        addExtension("binding.ws", new URL(base, "default.scdl"));
        base = getClass().getResource("/META-INF/sca/databinding.sdo.scdl");
        addExtension("databindning.sdo", new URL(base, "default.scdl"));
        super.setUp();
        CompositeContext compositeContext = CurrentCompositeContext.getContext();
        helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent");
    }

    public void testWSClient() throws Exception {
        String msg = helloWorldService.getGreetings("Smith");
        Assert.assertEquals("Hello Smith", msg);
View Full Code Here

    public static final void main(String[] args) throws Exception {
       
        // Locate the Customer component and invoke it
        CompositeContext context = CurrentCompositeContext.getContext();
        Customer customer =
                context.locateService(Customer.class, "CustomerComponent");

        System.out.println("Main thread " + Thread.currentThread());
        customer.purchaseGoods();
        System.out.println("Main thread sleeping ...");
        Thread.sleep(1000);
View Full Code Here

public class InnerCompositeClient {

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

        Source source = context.locateService(Source.class, "SourceComponent");
        System.out.println("Main thread " + Thread.currentThread());
        source.clientMethod("Client.main");
        Thread.sleep(500);
    }
}
View Full Code Here

    protected void setUp() throws Exception {
        setApplicationSCDL(SupplyChainClient.class, "META-INF/sca/default.scdl");
        super.setUp();

        CompositeContext context = CurrentCompositeContext.getContext();
        customer = context.locateService(Customer.class, "CustomerComponent");
    }

    public void test() throws Exception {

        System.out.println("Main thread " + Thread.currentThread());
View Full Code Here

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

        CompositeContext context = CurrentCompositeContext.getContext();

        AccountService accountService = context.locateService(AccountService.class, "AccountServiceComponent");

        AccountReport accountReport = accountService.getAccountReport(12345);

        for (Iterator i = accountReport.getAccountSummaries().iterator(); i.hasNext();) {
            AccountSummary accountSummary = (AccountSummary) i.next();
View Full Code Here

    protected void setUp() throws Exception {
        setApplicationSCDL(CalculatorService.class, "META-INF/sca/default.scdl");
        super.setUp();

        CompositeContext context = CurrentCompositeContext.getContext();
        calculatorService = context.locateService(CalculatorService.class, "CalculatorServiceComponent");
    }

    public void testCalculator() throws Exception {
        // Calculate
        assertEquals(calculatorService.add(3, 2), 5.0);
View Full Code Here

    protected void setUp() throws Exception {
        setApplicationSCDL(MyClient.class, "META-INF/sca/default.scdl");
        super.setUp();

        CompositeContext context = CurrentCompositeContext.getContext();
        myClient = context.locateService(MyClient.class, "MyClientComponent");
    }

    public void test() throws Exception {
        System.out.println("Main thread " + Thread.currentThread());
        myClient.aClientMethod();
View Full Code Here

public class GreeterClient {

    public final static void main(String[] args) throws Exception {
        CompositeContext compositeContext = CurrentCompositeContext.getContext();
        GreeterLocal greeterLocal =
            compositeContext.locateService(GreeterLocal.class, "GreeterServiceComponent");
        greeterLocal.greet("John");
        System.out.println("Sleeping for 5 seconds ...");
        Thread.sleep(5000);
        System.out.println("Done ...");
    }
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.