Package org.osoa.sca

Examples of org.osoa.sca.CompositeContext


public class HelloWorldClient {

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

        CompositeContext compositeContext = CurrentCompositeContext.getContext();
        HelloWorldLocal helloWorldLocal =
            compositeContext.locateService(HelloWorldLocal.class, "HelloWorldServiceComponent");
        helloWorldLocal.getGreetings("John");

        // Sleep for 5 seconds to wait the callback to happen
        Thread.sleep(5000);
    }
View Full Code Here


    public void doPost(HttpServletRequest pReq, HttpServletResponse pResp) throws ServletException {

        try {
            final String action = pReq.getParameter("action");

            CompositeContext moduleContext = CurrentCompositeContext.getContext();
            AccountService accountServices = (AccountService) moduleContext.locateService(AccountService.class, "AccountServiceComponent");
            if (accountServices == null) {
                throw new ServletException("AccountServiceComponent");
            }
            ProfileService profileServices = null;
            if (!"createAccount".equals(action)) {
                profileServices = moduleContext.locateService(ProfileService.class, "ProfileServiceComponent");
                if (profileServices == null) {
                    throw new ServletException("ProfileServiceComponent not found.");
                }
                if (!profileServices.isLoggedIn()) {
                    throw new ServletException("User id '" + profileServices.getId() + "' not logged on.");
View Full Code Here

            setApplicationSCDL(HelloWorldCallback.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();
            helloWorldLocal =
                compositeContext.locateService(HelloWorldLocal.class, "HelloWorldServiceComponent");
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
    }
View Full Code Here

        URL scdl = getClass().getClassLoader().getResource("META-INF/sca/js.system.scdl");
        addExtension("JavaScriptContainer", scdl);
        setApplicationSCDL(HelloWorldService.class, "META-INF/sca/default.scdl");
        super.setUp();

        CompositeContext context = CurrentCompositeContext.getContext();
        helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponent");
    }
View Full Code Here

    @Override
    public void stop() {
    }

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

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

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

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

    public void stop() {
    }

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

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

        if (loginService.login("test", "password") == LoginService.SUCCESS) {
            System.out.println("Success");
        } else {
            System.out.println("Failure");
View Full Code Here

        URL scdl = getClass().getClassLoader().getResource("META-INF/sca/ruby.system.scdl");
        addExtension("RubyContainer", scdl);
        setApplicationSCDL(HelloWorldService.class, "META-INF/sca/default.scdl");
        super.setUp();

        CompositeContext context = CurrentCompositeContext.getContext();
        helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponent");
    }
View Full Code Here

     *
     * @return
     */
    protected WSDLInteropTestDocLitPortType locateInteropDocService() {

        CompositeContext compositeContext = CurrentCompositeContext.getContext();
        return compositeContext.locateService(WSDLInteropTestDocLitPortType.class, "RemoteInteropDocService");

    }
View Full Code Here

        addExtension("test.exts", getClass().getClassLoader()
            .getResource("META-INF/tuscany/test-extensions.scdl"));

        super.setUp();
        CompositeContext compositeContext = CurrentCompositeContext.getContext();
        serviceProxy = compositeContext.locateService(Object.class, "webserviceXSQ");
    }
View Full Code Here

        // To specify the service name run mvn -interopLocation="Remote"

        if (interopLocation == null)
            interopLocation = "Remote";

        CompositeContext compositeContext = CurrentCompositeContext.getContext();

        return (DocTestPortType) compositeContext.locateService(DocTestPortType.class, interopLocation + "InteropDocService");
    }
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.