Package org.osoa.sca

Examples of org.osoa.sca.CompositeContext


public class SupplyChainClient {

    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


* @version $Rev: 478016 $ $Date: 2006-11-21 19:09:41 -0800 (Tue, 21 Nov 2006) $
*/
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");
    }
View Full Code Here

    public void stop() {
    }

    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");
    }
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");
    }
View Full Code Here

import org.osoa.sca.CurrentCompositeContext;

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

            setApplicationSCDL(GreeterService.class, "META-INF/sca/default.scdl");
            ClassLoader classLoader = getClass().getClassLoader();
            addExtension("test.extensions", classLoader.getResource("META-INF/tuscany/test-extensions.scdl"));

            super.setUp();
            CompositeContext compositeContext = CurrentCompositeContext.getContext();
            greeterLocal = compositeContext.locateService(GreeterLocal.class, "GreeterServiceComponent");
        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }
View Full Code Here

* locate the Calculator service and invoke it.
*/
public class CalculatorClient {
    public static void main(String[] args) throws Exception {

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

        // Calculate
        System.out.println("3 + 2=" + calculatorService.add(3, 2));
        System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
        System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
View Full Code Here

        }
    }

    static int login(final String login, final String password) throws ServletException {

        CompositeContext moduleContext = CurrentCompositeContext.getContext();
        LoginService loginMgr = moduleContext.locateService(LoginService.class, "LoginServiceComponent");

        if (loginMgr == null) {
            throw new ServletException("LoginManager not found");
        }
View Full Code Here

TOP

Related Classes of org.osoa.sca.CompositeContext

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.