Examples of RequestContext


Examples of com.netflix.explorers.context.RequestContext

        else {
            vars = new HashMap<String, Object>();
            vars.put("it", model);
        }

        RequestContext requestContext = new RequestContext();
        requestContext.setHttpServletRequest(requestInvoker != null ? requestInvoker.get() : null);
        vars.put("RequestContext",  requestContext);
        vars.put("Request",         requestInvoker != null ? requestInvoker.get() : null);
       
        Principal ctx = null;
        if (requestInvoker.get() != null) {
            ctx = requestInvoker.get().getUserPrincipal();
            if (ctx == null && requestInvoker.get().getSession(false) != null) {
                final String username = (String) requestInvoker.get().getSession().getAttribute("SSO_UserName");
                if (username != null) {
                    ctx = new Principal() {
                        @Override
                        public String getName() {
                            return username;
                        }
                    };
                }
            }
        }
        vars.put("Principal",  ctx);
       
        // The following are here for backward compatibility and should be deprecated as soon as possible
        Map<String, Object> global = Maps.newHashMap();
       
        if (manager != null) {
            GlobalModelContext globalModel = manager.getGlobalModel();
            global.put("sysenv",    globalModel.getEnvironment());      // TODO: DEPRECATE
        }
        vars.put("global",      global);                            // TODO: DEPRECATE
        vars.put("pathToRoot",  requestContext.getPathToRoot());    // TODO: DEPRECATE
       
        String layout = DEFAULT_LAYOUT;

        Explorer explorer = null;
        final boolean hasExplorerName = !requestContext.getExplorerName().isEmpty();
        try {
            if (hasExplorerName) {
                explorer = manager.getExplorer(requestContext.getExplorerName());
            }
        }
        catch (Exception e) {
            LOG.warn(e.getMessage());
        }
        if (explorer == null) {
            if (hasExplorerName) {
                throw new WebApplicationException(new RuntimeException("Invalid explorer"), Response.Status.NOT_FOUND);
            } else {
                explorer = EmptyExplorer.getInstance();
            }
        }

        layout = explorer.getLayoutName();
        vars.put("Explorer", explorer);
       
        if (vars.containsKey("layout")) {
            layout = (String) vars.get("layout");
        }




        final StringWriter stringWriter = new StringWriter();

        try {
            if (requestContext.getIsAjaxRequest()) {
              fmConfig.getTemplate(resolvedPath).process(vars, stringWriter);
            }
            else {
              if (layout == null) {
                layout = DEFAULT_LAYOUT;
View Full Code Here

Examples of com.netflix.zuul.context.RequestContext

        }
    }

    HttpResponse forward() throws Exception {

        RequestContext context = RequestContext.getCurrentContext();


        HttpRequest.Builder builder = HttpRequest.newBuilder().
                verb(verb).
                uri(uri).
                entity(requestEntity);

        for (String name : headers.keySet()) {
            List<String> values = headers.get(name);
            for (String value : values) {
                builder.header(name, value);
            }
        }

        for (String name : params.keySet()) {
            List<String> values = params.get(name);
            for (String value : values) {
                builder.queryParams(name, value);
            }
        }

        HttpRequest httpClientRequest = builder.build();

        HttpResponse response = restClient.executeWithLoadBalancer(httpClientRequest);
        context.set("ribbonResponse", response);
        return response;
    }
View Full Code Here

Examples of com.sun.enterprise.ee.synchronization.processor.RequestContext

        try {
            ConfigContext configCtx = AdminService.getAdminService().
                                getAdminContext().getAdminConfigContext();

            RequestContext rCtx = new RequestContext(configCtx, request);
            rCtx.setTimeDelta(_delta);

            ByteProcessor bProcessor = new ByteProcessor(rCtx);
            bProcessor.process();

            response = bProcessor.getResult();

        } catch (BufferOverflowException overflowEx) {

            _logger.log(Level.FINE,
                "Zipper reached max buffer size. Attempting a redirect.");

            ConfigContext configCtx = AdminService.getAdminService().
                                getAdminContext().getAdminConfigContext();

            RequestContext rCtx = new RequestContext(configCtx, request);
            rCtx.setTimeDelta(_delta);

            ZipProcessor zProcessor = new ZipProcessor(rCtx);
            zProcessor.process();

            response = zProcessor.getResult();
View Full Code Here

Examples of com.tll.server.RequestContext

  /**
   * @return The request context for the current request.
   */
  protected final RequestContext getRequestContext() {
    return new RequestContext(getThreadLocalRequest(), getThreadLocalResponse());
  }
View Full Code Here

Examples of com.tonbeller.wcf.controller.RequestContext

  public String getAnalysisDescription() {
    return analysisDescription;
  }

  public void setAnalysisDescription(String analysisDescription) {
    RequestContext context = RequestContext.instance();
    Locale locale = context.getLocale();
    if (analysisDescription == null) {
      this.analysisDescription = null;
      return;
    }
    this.analysisDescription = analysisDescription;
View Full Code Here

Examples of edu.stanford.bmir.protege.web.server.dispatch.RequestContext

    @Override
    public DispatchServiceResultContainer executeAction(Action action) throws ActionExecutionException, PermissionDeniedException {
        UserId userId = getUserInSession();
        HttpServletRequest request = getThreadLocalRequest();
        HttpSession session = request.getSession();
        final RequestContext requestContext = new RequestContext(userId, session);
        final ExecutionContext executionContext = new ExecutionContext(userId);
        return executor.execute(action, requestContext, executionContext);
    }
View Full Code Here

Examples of eu.admire.gateway.context.RequestContext

            "PE(<Connection in> => <Connection out>) B = PE(<Connection in=d.in> => <Connection out=e.out>);" +
            "register B;";
        registry.registerProcessingElement(desc, implementation);
        insert.setAdmireRegistry(registry);
        insert.setDispelOptimiser(new SimpleDispelOptimiser());
        RequestContext context = new MockRequestContext();
        Graph graph = new Graph();
        ProcessingElementNode a = new ProcessingElementNode("eu.admire.A");
        ProcessingElementNode b = new ProcessingElementNode("B");
        b.connectInput("in", 0, a.getOutput("out", 0));
        ProcessingElementNode c = new ProcessingElementNode("eu.admire.C");
View Full Code Here

Examples of fr.dyade.aaa.jndi2.server.RequestContext

                       "ReplicationManager[" +
                       getId() + "].onReply(" +
                       from + ',' + reply + ')');
    RequestContextList ctxList =
      (RequestContextList)writeRequestContextLists.get(from);
    RequestContext ctx = ctxList.get();
    ctxList.pop();
    if (ctxList.getSize() == 0) {
      writeRequestContextLists.remove(from);
    }   
    if (ctx != null) {
      ctx.reply(reply);
      saveWriteRequestTable();
    } else {
      Trace.logger.log(BasicLevel.ERROR,
                       "Reply context not found: " +
                       from + ", " + reply);
View Full Code Here

Examples of hr.fer.zemris.java.webserver.RequestContext

  }
 
  private static void demo1(String filePath, String encoding) throws IOException {
   
    OutputStream os = Files.newOutputStream(Paths.get(filePath));
    RequestContext rc = new RequestContext(os, new HashMap<String, String>(),
       
    new HashMap<String, String>(),
    new ArrayList<RequestContext.RCCookie>());
   
    rc.setEncoding(encoding);
    rc.setMimeType("text/plain");
    rc.setStatusCode(205);
    rc.setStatusText("Idemo dalje");
   
    // Only at this point will header be created and written...
    rc.write("Čevapčići i Šiščevapčići.");
    os.close();
  }
View Full Code Here

Examples of juzu.request.RequestContext

      Class<?> controllerType = handler.getType();
      request.controllerLifeCycle = manager.get(controllerType);
      if (request.controllerLifeCycle != null) {

        // Create context
        RequestContext context = new RequestContext(request, handler);

        // Build arguments
        Object[] args = new Object[handler.getParameters().size()];
        for (int i = 0;i < args.length;i++) {
          ControlParameter parameter = handler.getParameters().get(i);
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.