Codota Logo
HttpRequestContextImpl
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: weld/core

public boolean associate(HttpServletRequest request) {
  // At this point the bean store should never be set - see also HttpContextLifecycle#nestedInvocationGuard
  BoundBeanStore beanStore = getBeanStore();
  if (beanStore != null) {
    ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request);
    if (ContextLogger.LOG.isDebugEnabled()) {
      ContextLogger.LOG.beanStoreLeakAffectedBeanIdentifiers(this.getClass().getName(), Iterables.toMultiRowString(beanStore));
    }
  }
  // We always associate a new bean store to avoid possible leaks (security threats)
  beanStore = new RequestBeanStore(request, namingScheme);
  setBeanStore(beanStore);
  beanStore.attach();
  return true;
}
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
public void postContextRegistration(PostContextRegistrationContext ctx) {
  final BeanIdentifierIndex index = ctx.getServices().get(BeanIdentifierIndex.class);
  final String contextId = ctx.getContextId();
  if (Reflections.isClassLoadable(ServletApiAbstraction.SERVLET_CONTEXT_CLASS_NAME, WeldClassLoaderResourceLoader.INSTANCE)) {
    // Register the Http contexts if not in
    Set<Annotation> httpQualifiers = ImmutableSet.<Annotation> builder().addAll(Bindings.DEFAULT_QUALIFIERS).add(HttpLiteral.INSTANCE).build();
    ctx.addContext(new ContextHolder<HttpSessionContext>(new HttpSessionContextImpl(contextId, index), HttpSessionContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpSessionDestructionContext>(new HttpSessionDestructionContext(contextId, index), HttpSessionDestructionContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpConversationContext>(new LazyHttpConversationContextImpl(contextId, ctx.getServices()), HttpConversationContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpRequestContext>(new HttpRequestContextImpl(contextId), HttpRequestContext.class, httpQualifiers));
  }
}
origin: weld/core

  public HttpServletRequest getHttpServletRequest() {
    if (getBeanStore() instanceof RequestBeanStore) {
      return Reflections.<RequestBeanStore>cast(getBeanStore()).getRequest();
    }
    return null;
  }
}
origin: weld/core

@Override
public void postContextRegistration(PostContextRegistrationContext ctx) {
  final BeanIdentifierIndex index = ctx.getServices().get(BeanIdentifierIndex.class);
  final String contextId = ctx.getContextId();
  if (Reflections.isClassLoadable(ServletApiAbstraction.SERVLET_CONTEXT_CLASS_NAME, WeldClassLoaderResourceLoader.INSTANCE)) {
    // Register the Http contexts if not in
    Set<Annotation> httpQualifiers = ImmutableSet.<Annotation> builder().addAll(Bindings.DEFAULT_QUALIFIERS).add(HttpLiteral.INSTANCE).build();
    ctx.addContext(new ContextHolder<HttpSessionContext>(new HttpSessionContextImpl(contextId, index), HttpSessionContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpSessionDestructionContext>(new HttpSessionDestructionContext(contextId, index), HttpSessionDestructionContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpConversationContext>(new LazyHttpConversationContextImpl(contextId, ctx.getServices()), HttpConversationContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpRequestContext>(new HttpRequestContextImpl(contextId), HttpRequestContext.class, httpQualifiers));
  }
}
origin: weld/core

  public HttpServletRequest getHttpServletRequest() {
    if (getBeanStore() instanceof RequestBeanStore) {
      return Reflections.<RequestBeanStore>cast(getBeanStore()).getRequest();
    }
    return null;
  }
}
origin: org.jboss.weld.servlet/weld-servlet-shaded

public boolean associate(HttpServletRequest request) {
  // At this point the bean store should never be set - see also HttpContextLifecycle#nestedInvocationGuard
  BoundBeanStore beanStore = getBeanStore();
  if (beanStore != null) {
    ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request);
    if (ContextLogger.LOG.isDebugEnabled()) {
      ContextLogger.LOG.beanStoreLeakAffectedBeanIdentifiers(this.getClass().getName(), Iterables.toMultiRowString(beanStore));
    }
  }
  // We always associate a new bean store to avoid possible leaks (security threats)
  beanStore = new RequestBeanStore(request, namingScheme);
  setBeanStore(beanStore);
  beanStore.attach();
  return true;
}
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

@Override
public void postContextRegistration(PostContextRegistrationContext ctx) {
  final BeanIdentifierIndex index = ctx.getServices().get(BeanIdentifierIndex.class);
  final String contextId = ctx.getContextId();
  if (Reflections.isClassLoadable(ServletApiAbstraction.SERVLET_CONTEXT_CLASS_NAME, WeldClassLoaderResourceLoader.INSTANCE)) {
    // Register the Http contexts if not in
    Set<Annotation> httpQualifiers = ImmutableSet.<Annotation> builder().addAll(Bindings.DEFAULT_QUALIFIERS).add(HttpLiteral.INSTANCE).build();
    ctx.addContext(new ContextHolder<HttpSessionContext>(new HttpSessionContextImpl(contextId, index), HttpSessionContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpSessionDestructionContext>(new HttpSessionDestructionContext(contextId, index), HttpSessionDestructionContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpConversationContext>(new LazyHttpConversationContextImpl(contextId, ctx.getServices()), HttpConversationContext.class, httpQualifiers));
    ctx.addContext(new ContextHolder<HttpRequestContext>(new HttpRequestContextImpl(contextId), HttpRequestContext.class, httpQualifiers));
  }
}
origin: org.jboss.weld.servlet/weld-servlet-shaded

  public HttpServletRequest getHttpServletRequest() {
    if (getBeanStore() instanceof RequestBeanStore) {
      return Reflections.<RequestBeanStore>cast(getBeanStore()).getRequest();
    }
    return null;
  }
}
origin: weld/core

public boolean associate(HttpServletRequest request) {
  // At this point the bean store should never be set - see also HttpContextLifecycle#nestedInvocationGuard
  BoundBeanStore beanStore = getBeanStore();
  if (beanStore != null) {
    ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request);
    if (ContextLogger.LOG.isDebugEnabled()) {
      ContextLogger.LOG.beanStoreLeakAffectedBeanIdentifiers(this.getClass().getName(), Iterables.toMultiRowString(beanStore));
    }
  }
  // We always associate a new bean store to avoid possible leaks (security threats)
  beanStore = new RequestBeanStore(request, namingScheme);
  setBeanStore(beanStore);
  beanStore.attach();
  return true;
}
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

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.httpHttpRequestContextImpl

Most used methods

  • <init>
    Constructor
  • getBeanStore
  • getHttpServletRequest
  • setBeanStore

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • setContentView (Activity)
  • startActivity (Activity)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Reference (javax.naming)
  • JButton (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now