Package org.apache.myfaces.trinidad.context

Examples of org.apache.myfaces.trinidad.context.ComponentContextManager


    if (_inSuspendOrResume)
    {
      return;
    }

    ComponentContextManager compCtxMgr =
      RequestContext.getCurrentInstance().getComponentContextManager();
    ComponentContextChange change = compCtxMgr.peekChange();

    if (!(change instanceof CollectionComponentChange) ||
        ((CollectionComponentChange)change)._component != this)
    {
      _LOG.warning("COLLECTION_NOT_IN_CONTEXT", getId());
View Full Code Here


        _handleInvalidContextUsage("COMPONENT_NOT_IN_CHILDREN_VISITING_CONTEXT",
          _tearDownChildrenVisitingCaller);
      }

      // Next, remove the context change that was added in setupChildrenVisitingContext:
      ComponentContextManager componentContextManager =
        RequestContext.getCurrentInstance().getComponentContextManager();

      ComponentContextChange contextChange = componentContextManager.popChange();
      // Validate the state of the context change stack:
      if (!(contextChange instanceof VisitChildrenDebugContextChange) ||
          ((VisitChildrenDebugContextChange)contextChange)._component != this)
      {
        throw new IllegalStateException(_getInvalidContextChangeMessage(
View Full Code Here

   * @see ComponentContextManager#suspend(FacesContext)
   */
  @Override
  protected void setupVisitingContext(FacesContext facesContext)
  {
    ComponentContextManager ctxMgr = RequestContext.getCurrentInstance()
      .getComponentContextManager();

    // Suspend any current component context during a visit tree for re-entrant
    // component tree processing
    SuspendedContextChanges suspendedChanges = ctxMgr.suspend(facesContext);

    Map<String, Object> reqMap = facesContext.getExternalContext().getRequestMap();
    @SuppressWarnings("unchecked")
    Queue<SuspendedContextChanges> suspendedChangesQueue = (Queue<SuspendedContextChanges>)
      reqMap.get(_SUSPENDED_CHANGES_KEY);
View Full Code Here

  @Override
  protected void tearDownVisitingContext(FacesContext facesContext)
  {
    super.tearDownVisitingContext(facesContext);

    ComponentContextManager ctxMgr = RequestContext.getCurrentInstance()
      .getComponentContextManager();
    Map<String, Object> reqMap = facesContext.getExternalContext().getRequestMap();
    @SuppressWarnings("unchecked")
    Queue<SuspendedContextChanges> suspendedChangesQueue = (Queue<SuspendedContextChanges>)
      reqMap.get(_SUSPENDED_CHANGES_KEY);
    SuspendedContextChanges changes = suspendedChangesQueue.poll();
    ctxMgr.resume(facesContext, changes);
  }
View Full Code Here

        _handleInvalidContextUsage("COMPONENT_ALREADY_IN_VISITING_CONTEXT", _setupVisitingCaller);
      }

      // Next, add a context change so that the flags are reset during an
      // invokeOnComponent(context, clientId, callback), or a visitTree call:
      ComponentContextManager componentContextManager =
        RequestContext.getCurrentInstance().getComponentContextManager();
      componentContextManager.pushChange(new VisitDebugContextChange(this));
      _inVisitingContext = true;
      _setupVisitingCaller = _getStackTraceElementForCaller();
    }
  }
View Full Code Here

      // Next, add a context change so that the flags are reset during an
      // invokeOnComponent(context, clientId, callback), or a visitTree call
      // (Note that a separate one is needed for the children due to the fact that currently
      // the encoding context / visiting context is not set up during normal tree traversal,
      // but the children encoding context is setup by the renderers):
      ComponentContextManager componentContextManager =
        RequestContext.getCurrentInstance().getComponentContextManager();
      componentContextManager.pushChange(new VisitChildrenDebugContextChange(this));
      _inChildrenVisitingContext = true;
      _setupChildrenVisitingCaller = _getStackTraceElementForCaller();
    }
  }
View Full Code Here

      {
        _handleInvalidContextUsage("COMPONENT_NOT_IN_VISITING_CONTEXT", _tearDownVisitingCaller);
      }

      // Next, remove the context change that was added in setupVisitingContext:
      ComponentContextManager componentContextManager =
        RequestContext.getCurrentInstance().getComponentContextManager();

      ComponentContextChange contextChange = componentContextManager.popChange();

      // Validate the state of the context change stack:
      if (!(contextChange instanceof VisitDebugContextChange) ||
          ((VisitDebugContextChange)contextChange)._component != this)
      {
View Full Code Here

   * @see ComponentContextManager#suspend(FacesContext)
   */
  @Override
  protected void setupVisitingContext(FacesContext facesContext)
  {
    ComponentContextManager ctxMgr = RequestContext.getCurrentInstance()
      .getComponentContextManager();

    // Suspend any current component context during a visit tree for re-entrant
    // component tree processing
    SuspendedContextChanges suspendedChanges = ctxMgr.suspend(facesContext);

    Map<String, Object> reqMap = facesContext.getExternalContext().getRequestMap();
    @SuppressWarnings("unchecked")
    Queue<SuspendedContextChanges> suspendedChangesQueue = (Queue<SuspendedContextChanges>)
      reqMap.get(_SUSPENDED_CHANGES_KEY);
View Full Code Here

  @Override
  protected void tearDownVisitingContext(FacesContext facesContext)
  {
    super.tearDownVisitingContext(facesContext);

    ComponentContextManager ctxMgr = RequestContext.getCurrentInstance()
      .getComponentContextManager();
    Map<String, Object> reqMap = facesContext.getExternalContext().getRequestMap();
    @SuppressWarnings("unchecked")
    Queue<SuspendedContextChanges> suspendedChangesQueue = (Queue<SuspendedContextChanges>)
      reqMap.get(_SUSPENDED_CHANGES_KEY);
    SuspendedContextChanges changes = suspendedChangesQueue.poll();
    ctxMgr.resume(facesContext, changes);
    _LOG.fine("UIXDocument resumed context changes in setupVisitingContext");
  }
View Full Code Here

   * @see ComponentContextManager#suspend(FacesContext)
   */
  @Override
  protected void setupVisitingContext(FacesContext facesContext)
  {
    ComponentContextManager ctxMgr = RequestContext.getCurrentInstance()
      .getComponentContextManager();

    // Suspend any current component context during a visit tree for re-entrant
    // component tree processing
    SuspendedContextChanges suspendedChanges = ctxMgr.suspend(facesContext);

    Map<String, Object> reqMap = facesContext.getExternalContext().getRequestMap();
    @SuppressWarnings("unchecked")
    Queue<SuspendedContextChanges> suspendedChangesQueue = (Queue<SuspendedContextChanges>)
      reqMap.get(_SUSPENDED_CHANGES_KEY);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.context.ComponentContextManager

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.