Examples of locateService()


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

    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

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

    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

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

    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

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

    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

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

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

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

    public static void main(String[] args) throws Exception {
        TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.account.testclient", null);
        tuscany.start();
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        AccountService accountService = (AccountService) moduleContext.locateService("AccountServiceComponent");

        AccountReport accountReport = accountService.getAccountReport(12345);

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

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

    public static void main(String[] args) throws Exception {
        TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.webclient.testclient", null);
        tuscany.start();
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        AccountService accountService = (AccountService) moduleContext.locateService("AccountServiceComponent");

        AccountReport report = accountService.getAccountReport(12345);
        List summaries = report.getAccountSummaries();

        System.out.println("retrieved " + summaries.size() + " summaries");
View Full Code Here

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

        mId = pId;
    }

    public int doStartTag() throws JspException {
        ModuleContext moduleContext = CurrentModuleContext.getContext();
        Object service = moduleContext.locateService(mName);
        if (service == null) {
            throw new JspException("Service [" + mName + "] not found in current module context");
        }
        if (mId == null) {
            // if the Id name was not specified, default to the basic name of the
View Full Code Here

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

            throw new JspException("Invalid profile location specified");
        }

        ModuleContext moduleContext = CurrentModuleContext.getContext();

        ProfileService profile = (ProfileService) moduleContext.locateService(mProfile);

        if (profile == null) {
            throw new JspException("Profile [" + mProfile + "] not found in current module context");
        }
View Full Code Here

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

    private Iterator mIterator;

    public int doStartTag() throws JspException {
        ModuleContext moduleContext = CurrentModuleContext.getContext();
        ProfileService profile = (ProfileService) moduleContext.locateService(mProfileService);
        if (profile == null) {
            throw new JspException("Profile [" + mProfileService + "] not found in current module context");
        }

        AccountService service = (AccountService) moduleContext.locateService(mAccountService);
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.