Examples of locateService()


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

        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);
        if (service == null) {
            throw new JspException("Service [" + mAccountService + "] not found in current module context");
        }
        List summaries;
        try {
View Full Code Here

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

    }

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

        ModuleContext moduleContext = CurrentModuleContext.getContext();
        LoginService loginMgr = (LoginService) moduleContext.locateService("LoginServiceComponent");

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

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

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

        try {
            final String action = pReq.getParameter("action");
            ModuleContext moduleContext = CurrentModuleContext.getContext();
            AccountService accountServices = (AccountService) moduleContext.locateService("AccountServiceComponent");
            if (accountServices == null) {
                throw new ServletException("AccountServiceComponent");
            }
            ProfileService profileServices = null;
            if (!"createAccount".equals(action)) {
View Full Code Here

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

            if (accountServices == null) {
                throw new ServletException("AccountServiceComponent");
            }
            ProfileService profileServices = null;
            if (!"createAccount".equals(action)) {
                profileServices = (ProfileService) moduleContext.locateService("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

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

        // Get the SCA module context.
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        // Locate the HelloWorld service
        HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldService");
       
        // Invoke the HelloWorld service
        String value = helloworldService.getGreetings("World");
       
        System.out.println(value);
View Full Code Here

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

        TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.webclient.testclient", null);
        tuscany.start();
        ModuleContext moduleContext = CurrentModuleContext.getContext();
        LoginService loginService = (LoginService)
                moduleContext.locateService("LoginServiceComponent");

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

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

        TuscanyRuntime tuscany = new TuscanyRuntime("test", "foo");
        tuscany.start();
        ModuleContext moduleContext = CurrentModuleContext.getContext();
        assertNotNull(moduleContext);
        assertEquals("foo", moduleContext.getURI());
        HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorld");
        assertNotNull(helloworldService);

        String value = helloworldService .getGreetings("World");
        assertEquals("Hello World", value);
        tuscany.stop();
View Full Code Here

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

        // Get the SCA module context.
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        // Locate the CustomerInfo service
        Object customerInfoService = moduleContext.locateService("CustomerInfoServiceComponent");
       
        // Invoke the CustomerInfo service
        Method getCustomerInfo = customerInfoService.getClass().getMethod("getCustomerInfo", new Class[] {String.class});
        DataObject customer = (DataObject)getCustomerInfo.invoke(customerInfoService, "12345");
       
View Full Code Here

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

        // Get the SCA module context.
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        // Locate the HelloWorld service
        HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent");
       
        // Invoke the HelloWorld service
        String value = helloworldService.getGreetings("World");
       
        assertEquals(value, "Hello World");
View Full Code Here

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

        // Get the SCA module context.
        ModuleContext moduleContext = CurrentModuleContext.getContext();

        // Locate the HelloWorld service
        HelloWorldService helloworldService = (HelloWorldService) moduleContext.locateService("HelloWorldServiceComponent");
       
        // Invoke the HelloWorld service
        String value = helloworldService.getGreetings("World");
       
        System.out.println(value);
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.