Tabnine Logo
HttpRequestContextImpl.getHttpServletRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
getHttpServletRequest
method
in
org.jboss.weld.module.web.context.http.HttpRequestContextImpl

Best Java code snippets using org.jboss.weld.module.web.context.http.HttpRequestContextImpl.getHttpServletRequest (Showing top 6 results out of 315)

origin: weld/core

@Override
protected HttpServletRequest newInstance(InjectionPoint ip, CreationalContext<HttpServletRequest> creationalContext) {
  try {
    Context context = getBeanManager().getContext(RequestScoped.class);
    if (context instanceof HttpRequestContextImpl) {
      return Reflections.<HttpRequestContextImpl> cast(context).getHttpServletRequest();
    }
    throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), null);
  } catch (ContextNotActiveException e) {
    throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), e);
  }
}
origin: weld/core

@Override
protected HttpServletRequest newInstance(InjectionPoint ip, CreationalContext<HttpServletRequest> creationalContext) {
  try {
    Context context = getBeanManager().getContext(RequestScoped.class);
    if (context instanceof HttpRequestContextImpl) {
      return Reflections.<HttpRequestContextImpl> cast(context).getHttpServletRequest();
    }
    throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), null);
  } catch (ContextNotActiveException e) {
    throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), e);
  }
}
origin: org.jboss.weld.servlet/weld-servlet-shaded

@Override
protected HttpServletRequest newInstance(InjectionPoint ip, CreationalContext<HttpServletRequest> creationalContext) {
  try {
    Context context = getBeanManager().getContext(RequestScoped.class);
    if (context instanceof HttpRequestContextImpl) {
      return Reflections.<HttpRequestContextImpl> cast(context).getHttpServletRequest();
    }
    throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), null);
  } catch (ContextNotActiveException e) {
    throw ServletLogger.LOG.cannotInjectObjectOutsideOfServletRequest(HttpServletRequest.class.getSimpleName(), e);
  }
}
origin: weld/core

public void sessionDestroyed(HttpSession session) {
  // Mark the session context and conversation contexts to destroy
  // instances when appropriate
  deactivateSessionDestructionContext(session);
  boolean destroyed = getSessionContext().destroy(session);
  SessionHolder.clear();
  RequestScopedCache.endRequest();
  if (destroyed) {
    // we are outside of a request (the session timed out) and therefore the session was destroyed immediately
    // we can fire the @Destroyed(SessionScoped.class) event immediately
    sessionDestroyedEvent.fire(session);
  } else {
    // the old session won't be available at the time we destroy this request
    // let's store its reference until then
    if (getRequestContext() instanceof HttpRequestContextImpl) {
      HttpServletRequest request = Reflections.<HttpRequestContextImpl> cast(getRequestContext()).getHttpServletRequest();
      request.setAttribute(HTTP_SESSION, session);
    }
  }
}
origin: weld/core

public void sessionDestroyed(HttpSession session) {
  // Mark the session context and conversation contexts to destroy
  // instances when appropriate
  deactivateSessionDestructionContext(session);
  boolean destroyed = getSessionContext().destroy(session);
  SessionHolder.clear();
  RequestScopedCache.endRequest();
  if (destroyed) {
    // we are outside of a request (the session timed out) and therefore the session was destroyed immediately
    // we can fire the @Destroyed(SessionScoped.class) event immediately
    sessionDestroyedEvent.fire(session);
  } else {
    // the old session won't be available at the time we destroy this request
    // let's store its reference until then
    if (getRequestContext() instanceof HttpRequestContextImpl) {
      HttpServletRequest request = Reflections.<HttpRequestContextImpl> cast(getRequestContext()).getHttpServletRequest();
      request.setAttribute(HTTP_SESSION, session);
    }
  }
}
origin: org.jboss.weld.servlet/weld-servlet-shaded

public void sessionDestroyed(HttpSession session) {
  // Mark the session context and conversation contexts to destroy
  // instances when appropriate
  deactivateSessionDestructionContext(session);
  boolean destroyed = getSessionContext().destroy(session);
  SessionHolder.clear();
  RequestScopedCache.endRequest();
  if (destroyed) {
    // we are outside of a request (the session timed out) and therefore the session was destroyed immediately
    // we can fire the @Destroyed(SessionScoped.class) event immediately
    sessionDestroyedEvent.fire(session);
  } else {
    // the old session won't be available at the time we destroy this request
    // let's store its reference until then
    if (getRequestContext() instanceof HttpRequestContextImpl) {
      HttpServletRequest request = Reflections.<HttpRequestContextImpl> cast(getRequestContext()).getHttpServletRequest();
      request.setAttribute(HTTP_SESSION, session);
    }
  }
}
org.jboss.weld.module.web.context.httpHttpRequestContextImplgetHttpServletRequest

Popular methods of HttpRequestContextImpl

  • <init>
    Constructor
  • getBeanStore
  • setBeanStore

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • putExtra (Intent)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Reference (javax.naming)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now