Package com.caucho.config.scope

Examples of com.caucho.config.scope.ContextContainer


  public void close()
  {
    ResinBeanContainer cdiContainer = _cdiContainer;
    _cdiContainer = null;
   
    ContextContainer context = _context;
    _context = null;
   
    if (context != null) {
      context.close();
    }
   
    if (cdiContainer != null)
      cdiContainer.completeRequest(this);
  }
View Full Code Here


  protected ContextContainer createContextContainer()
  {
    Scope scope = createConversationScope();

    if (scope._transientConversation == null) {
      scope._transientConversation = new ContextContainer();
    }
   
    return scope._transientConversation;
  }
View Full Code Here

  private void destroy(Scope scope, boolean isClearId)
  { 
    if (scope == null)
      return;
   
    ContextContainer context = scope._transientConversation;
   
    if (isClearId)
      scope._transientConversation = null;
   
    if (scope._extendedId == null)
      context.close();
   
    if (isClearId)
      scope._extendedId = null;
  }
View Full Code Here

        throw new IllegalStateException(L.l("Conversation id={0} is an unknown conversation",
                                            scope._extendedId));
      }
    }
    else
      scope._transientConversation = new ContextContainer();
   
    return scope;
  }
View Full Code Here

    HttpSession session = ((HttpServletRequest) request).getSession();

    if (session == null)
      return null;

    ContextContainer context
      = (ContextContainer) session.getAttribute("resin.candi.scope");
   
    if (context == null) {
      context = new SessionContextContainer();
      session.setAttribute("resin.candi.scope", context);
View Full Code Here

    ServletRequest request = ServletInvocation.getContextRequest();

    if (request == null)
      return null;

    ContextContainer context
      = (ContextContainer) request.getAttribute("webbeans.resin");

    if (context != null) {
      String id = ((PassivationCapable) bean).getId();

      return (T) context.get(id);
    }

    return null;
  }
View Full Code Here

    Bean<T> comp = (Bean) bean;

    String id = ((PassivationCapable) bean).getId();

    ContextContainer context
      = (ContextContainer) request.getAttribute("webbeans.resin");

    if (context == null) {
      context = new ContextContainer();
      request.setAttribute("webbeans.resin", context);
    }

    T result = (T) context.get(id);

    if (result != null || creationalContext == null)
      return result;

    result = comp.create(creationalContext);

    context.put(comp, id, result, creationalContext);

    return result;
  }
View Full Code Here

    HttpSession session = ((HttpServletRequest) request).getSession();

    if (session == null)
      return null;

    ContextContainer context
      = (ContextContainer) session.getAttribute("webbeans.resin");

    if (context != null) {
      String id = ((PassivationCapable) bean).getId();

      return (T) context.get(id);
    }

    return null;
  }
View Full Code Here

    if (bean instanceof PassivationCapable)
      id = ((PassivationCapable) bean).getId();
    else
      id = comp.getBeanClass().getName();

    ContextContainer context
      = (ContextContainer) session.getAttribute("webbeans.resin");

    if (context == null) {
      context = new SessionContextContainer();
      session.setAttribute("webbeans.resin", context);
    }

    T result = (T) context.get(id);

    if (result != null || creationalContext == null)
      return result;

    result = comp.create(creationalContext);

    context.put(comp, id, result, creationalContext);

    return (T) result;
  }
View Full Code Here

   
    if (request == null)
      throw new IllegalStateException(L.l("end() requires a matching begin()"));
     
    if (--request._depth == 0) {
      ContextContainer context = request._context;
      request._context = null;
     
      if (context != null)
        context.close();
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.config.scope.ContextContainer

Copyright © 2018 www.massapicom. 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.