Examples of RequestContext


Examples of org.apache.wicket.RequestContext

  protected void createRequestContext(WebRequest request, WebResponse response)
  {
    if (filterPortletContext == null ||
      !filterPortletContext.createPortletRequestContext(request, response))
    {
      new RequestContext();
    }
  }
View Full Code Here

Examples of org.exoplatform.web.application.RequestContext

                PortletInfo info = portlet.getInfo();
                MetaInfo meta = info.getMeta();
                displayName = meta.getMetaValue(MetaInfo.DISPLAY_NAME);
                String value = null;
                if (displayName != null) {
                    RequestContext i = PortalRequestContext.getCurrentInstance();
                    Locale locale = i.getLocale();
                    value = displayName.getString(locale, true);
                }
                if (value == null || value.length() == 0) {
                    value = info.getName();
                }
                return value;
            } else {
                return "";
            }
        } else {
            RequestContext i = PortalRequestContext.getCurrentInstance();
            Locale locale = i.getLocale();
            String value = displayName.getString(locale, true);

            if (ParameterValidation.isNullOrEmpty(value)) {
                org.gatein.pc.api.Portlet portlet = getProducedOfferedPortlet();
                PortletInfo info = portlet.getInfo();
View Full Code Here

Examples of org.glassfish.tyrus.core.RequestContext

            final TyrusHttpUpgradeHandlerProxy handler = new TyrusHttpUpgradeHandlerProxy();

            final TyrusServletWriter webSocketConnection = new TyrusServletWriter(handler);

            final RequestContext requestContext = RequestContext.Builder.create()
                    .requestURI(URI.create(httpServletRequest.getRequestURI()))
                    .queryString(httpServletRequest.getQueryString())
                    .httpSession(httpServletRequest.getSession(false))
                    .secure(httpServletRequest.isSecure())
                    .userPrincipal(httpServletRequest.getUserPrincipal())
                    .isUserInRoleDelegate(new RequestContext.Builder.IsUserInRoleDelegate() {
                        @Override
                        public boolean isUserInRole(String role) {
                            return httpServletRequest.isUserInRole(role);
                        }
                    })
                    .parameterMap(httpServletRequest.getParameterMap())
                    .remoteAddr(httpServletRequest.getRemoteAddr())
                    .build();

            Enumeration<String> headerNames = httpServletRequest.getHeaderNames();

            while (headerNames.hasMoreElements()) {
                String name = headerNames.nextElement();

                final List<String> values = requestContext.getHeaders().get(name);
                if (values == null) {
                    requestContext.getHeaders().put(name, Utils.parseHeaderValue(httpServletRequest.getHeader(name).trim()));
                } else {
                    values.addAll(Utils.parseHeaderValue(httpServletRequest.getHeader(name).trim()));
                }
            }

            final TyrusUpgradeResponse tyrusUpgradeResponse = new TyrusUpgradeResponse();
            final WebSocketEngine.UpgradeInfo upgradeInfo = engine.upgrade(requestContext, tyrusUpgradeResponse);
            switch (upgradeInfo.getStatus()) {
                case HANDSHAKE_FAILED:
                    httpServletResponse.sendError(tyrusUpgradeResponse.getStatus());
                    break;
                case NOT_APPLICABLE:
                    filterChain.doFilter(request, response);
                    break;
                case SUCCESS:
                    LOGGER.fine("Upgrading Servlet request");

                    handler.setHandler(httpServletRequest.upgrade(TyrusHttpUpgradeHandler.class));
                    final String frameBufferSize = request.getServletContext().getInitParameter(TyrusHttpUpgradeHandler.FRAME_BUFFER_SIZE);
                    if (frameBufferSize != null) {
                        handler.setIncomingBufferSize(Integer.parseInt(frameBufferSize));
                    }

                    handler.preInit(upgradeInfo, webSocketConnection, httpServletRequest.getUserPrincipal() != null);

                    if (requestContext.getHttpSession() != null) {
                        sessionToHandler.put((HttpSession) requestContext.getHttpSession(), handler);
                    }

                    httpServletResponse.setStatus(tyrusUpgradeResponse.getStatus());
                    for (Map.Entry<String, List<String>> entry : tyrusUpgradeResponse.getHeaders().entrySet()) {
                        httpServletResponse.addHeader(entry.getKey(), Utils.getHeaderFromList(entry.getValue()));
View Full Code Here

Examples of org.jboss.arquillian.warp.spi.context.RequestContext

    @Inject
    private Instance<RequestContext> requestContextInstance;

    public void createRequestContext(@Observes(precedence = 100) EventContext<BeforeRequest> context) {
        RequestContext requestContext = this.requestContextInstance.get();
        requestContext.activate();
        context.proceed();
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.RequestContext

                res = (String) resMap.get(null);//Try with no-language resource.
            if (res == null)
                res = (String) resMap.get(getLocaleManager().getDefaultLang());//Try with default lang

            res = getBaseDir() + "/" + res;
            RequestContext reqCtx = RequestContext.getCurrentContext();
            if (reqCtx != null) {
                //Resources are best retrieved through URL (the fastest way)
                log.debug("Resource relative name = " + res);
                String categoryMapping = getMappingDir();
                log.debug("Category where the resource belongs to is mapped to uri " + categoryMapping);
                String url = categoryMapping + "/" + res;
                log.debug("Returning UrlResource to " + url);
                return UrlResource.getInstance(resourceName, reqCtx.getRequest().getRequestObject().getContextPath(), url);
            } else {
                //Create a FileResource...
                try {
                    checkDeployment();
                    return FileResource.getInstance(resourceName, new File(Application.lookup().getBaseAppDirectory() + getMappingDir() + "/" + res));
View Full Code Here

Examples of org.jboss.seam.remoting.RequestContext

      log.debug("Processing model request: " + requestData);

      SAXReader xmlReader = new SAXReader();
      Document doc = xmlReader.read(new StringReader(requestData));
      final Element env = doc.getRootElement();
      final RequestContext ctx = new RequestContext(env.element("header"));
     
      try
      {
         activateConversationContext(request, ctx.getConversationId());
  
         Element modelElement = env.element("body").element("model");
         String operation = modelElement.attributeValue("operation");
          
         if ("expand".equals(operation))
         {
            processExpandRequest(modelElement, ctx, response.getOutputStream())
         }
         else
         {
            Model model = null;
            if ("fetch".equals(operation))
            {
               model = processFetchRequest(modelElement);
            }
            else if ("apply".equals(operation))
            {
               model = processApplyRequest(modelElement);
            }
     
            if (model.getAction() != null && model.getAction().getException() != null)
            {
               response.getOutputStream().write(ENVELOPE_TAG_OPEN);
               response.getOutputStream().write(BODY_TAG_OPEN);        
               MarshalUtils.marshalException(model.getAction().getException(),
                     model.getAction().getContext(), response.getOutputStream());
               response.getOutputStream().write(BODY_TAG_CLOSE);
               response.getOutputStream().write(ENVELOPE_TAG_CLOSE);
               response.getOutputStream().flush();
               return;
            }
           
            model.evaluate();
           
            ctx.setConversationId(conversation.isTransient() ? null : conversation.getId());
            marshalResponse(model, ctx, response.getOutputStream());
         }
      }
      finally
      {
View Full Code Here

Examples of org.jboss.security.xacml.interfaces.RequestContext

      }
      if(childElement.getLocalName().equals("Request")
            && childElement.getNamespaceURI().equals(XACMLConstants.CONTEXT_SCHEMA))
      {
         //process the xacml request
         RequestContext requestContext = RequestResponseContextFactory.createRequestCtx();
         try
         {
            requestContext.readRequest(childElement);
         }
         catch (IOException e)
         {
            throw new RuntimeException(e);
         }
View Full Code Here

Examples of org.jboss.weld.context.RequestContext

        String pathInfo = req.getPathInfo();
        if (pathInfo == null)
            return;

        try {
            RequestContext requestContext = getActiveContext(beanManager, RequestContext.class);
            Bean<KleinStadt> stadtBean = Utils.getBean(beanManager, KleinStadt.class);
            if (pathInfo.equals("/request1")) {
                assertNotNull("Expected a bean for stateful session bean Kassel", stadtBean);
                CreationalContext<KleinStadt> creationalContext = beanManager.createCreationalContext(stadtBean);
                KleinStadt kassel = requestContext.get(stadtBean, creationalContext);
                stadtBean.destroy(kassel, creationalContext);

                assertTrue("Expected SFSB bean to be destroyed", frankfurt.isKleinStadtDestroyed());
                return;
            } else if (pathInfo.equals("/request2")) {
                KleinStadt kassel = requestContext.get(stadtBean);
                assertNull("SFSB bean should not exist after being destroyed", kassel);
                return;
            }
        } catch (AssertionError e) {
            resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
View Full Code Here

Examples of org.mojavemvc.aop.RequestContext

        Object[] args = new Object[] {};

        if (paramterTypes != null && paramterTypes.length == 1 && paramterTypes[0].equals(RequestContext.class)) {

            args = new Object[1];
            args[0] = new RequestContext(request, response, actionArgs,
                    action, controller, actionAnnotations, entity, marshalledEntity);
        }

        return args;
    }
View Full Code Here

Examples of org.oasisopen.sca.RequestContext

        this.componentContext = context;
    }

    @Init
    public void init() {
        RequestContext rc = componentContext.getRequestContext();
        if (rc != null) {
            rcContent = "NotNull";
        } else {
            rcContent = "Null";
        }
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.