Exemplo n.º 1
0
 public HttpServiceInstance createHttpService(
     String service_name,
     HttpServletRequest request,
     HttpServletResponse response,
     IProcedureManager procedureManager,
     CompositeMap context) {
   HttpServiceInstance svc = new HttpServiceInstance(service_name, procedureManager);
   svc.setRequest(request);
   svc.setResponse(response);
   svc.setContextMap(context);
   svc.setName(service_name);
   HttpRequestTransfer.copyRequest(svc);
   HttpSessionCopy.copySession(svc.getContextMap(), request.getSession(false));
   IContainer container = (IContainer) objectRegistry.getInstanceOfType(IContainer.class);
   Configuration config = (Configuration) container.getEventDispatcher();
   if (config != null) svc.setRootConfig(config);
   return svc;
 }
Exemplo n.º 2
0
  public void executeLoginProc(
      HttpServletRequest request, HttpServletResponse response, String loginName) throws Exception {
    IProcedureManager procedureManager =
        (IProcedureManager) objectRegistry.getInstanceOfType(IProcedureManager.class);
    IServiceFactory serviceFactory =
        (IServiceFactory) objectRegistry.getInstanceOfType(IServiceFactory.class);
    Procedure proc = procedureManager.loadProcedure(autoLoginProc);
    CompositeMap auroraContext = new CompositeMap("sso_conext");
    auroraContext.createChild("parameter").put("user_name", loginName);

    HttpServiceInstance svc =
        createHttpService(autoLoginProc, request, response, procedureManager, auroraContext);

    ServiceThreadLocal.setCurrentThreadContext(auroraContext);
    ServiceInvoker.invokeProcedureWithTransaction(
        autoLoginProc, proc, serviceFactory, svc, auroraContext);

    ServiceThreadLocal.setCurrentThreadContext(auroraContext);
    HttpRequestTransfer.copyRequest(svc);
    HttpSessionCopy.copySession(auroraContext, request.getSession(false));
  }