當前位置: 首頁>>代碼示例>>Java>>正文


Java PhaseListener類代碼示例

本文整理匯總了Java中javax.faces.event.PhaseListener的典型用法代碼示例。如果您正苦於以下問題:Java PhaseListener類的具體用法?Java PhaseListener怎麽用?Java PhaseListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PhaseListener類屬於javax.faces.event包,在下文中一共展示了PhaseListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getListener

import javax.faces.event.PhaseListener; //導入依賴的package包/類
public PhaseListener getListener() {
    return new PhaseListener() {
        private static final long serialVersionUID = -66585096775189540L;

        public PhaseId getPhaseId() {
            return PhaseId.RENDER_RESPONSE;
        }

        public void beforePhase(PhaseEvent event) {
            unselectCategory();
        }

        public void afterPhase(PhaseEvent arg0) {
            // nothing
        }
    };
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:18,代碼來源:CategorySelectionBean.java

示例2: installListener

import javax.faces.event.PhaseListener; //導入依賴的package包/類
static void installListener(
  FacesContext facesContext)
{
  UIViewRoot viewRoot = facesContext.getViewRoot();

  // See if the phase listener has already been added (only add it once)
  Map<String, Object> viewAttrs = viewRoot.getAttributes();
  if (!viewAttrs.containsKey(_PL_KEY))
  {
    PhaseListener newPhaseListener = new CleanupPhaseListener();
    viewRoot.addPhaseListener(newPhaseListener);

    viewAttrs.put(_PL_KEY, Boolean.TRUE);

    _LOG.finer("Cleanup phase listener has been installed");
  }
  else
  {
    _LOG.finest("Cleanup phase listener has already been installed on the current view");
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:22,代碼來源:ForEachTag.java

示例3: JsfRequestLifecycleBroadcaster

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Inject
protected JsfRequestLifecycleBroadcaster(Instance<PhaseListener> phaseListenerInstance)
{
    Class phaseListenerClass;
    for (PhaseListener currentPhaseListener : phaseListenerInstance)
    {
        phaseListenerClass = ProxyUtils.getUnproxiedClass(currentPhaseListener.getClass());

        if (phaseListenerClass.isAnnotationPresent(JsfPhaseListener.class))
        {
            if (Deactivatable.class.isAssignableFrom(phaseListenerClass) &&
                !ClassDeactivationUtils.isActivated(phaseListenerClass))
            {
                continue;
            }
            this.phaseListeners.add(currentPhaseListener);
        }
    }

    //higher ordinals first
    sortDescending(this.phaseListeners);
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:23,代碼來源:JsfRequestLifecycleBroadcaster.java

示例4: broadcastBeforeEvent

import javax.faces.event.PhaseListener; //導入依賴的package包/類
protected void broadcastBeforeEvent(PhaseEvent phaseEvent)
{
    //TODO discuss exception handling

    //fire to phase-observer methods
    this.phaseEvent.select(createAnnotationLiteral(phaseEvent.getPhaseId(), true)).fire(phaseEvent);
    this.beforeAnyPhaseEvent.fire(phaseEvent);

    //fire to ds-phase-listeners
    for (PhaseListener phaseListener : this.phaseListeners)
    {
        PhaseId targetPhase = phaseListener.getPhaseId();

        if (targetPhase == PhaseId.ANY_PHASE || targetPhase == phaseEvent.getPhaseId())
        {
            phaseListener.beforePhase(phaseEvent);
        }
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:20,代碼來源:JsfRequestLifecycleBroadcaster.java

示例5: broadcastAfterEvent

import javax.faces.event.PhaseListener; //導入依賴的package包/類
protected void broadcastAfterEvent(PhaseEvent phaseEvent)
{
    //TODO discuss exception handling

    //fire to phase-observer methods
    this.phaseEvent.select(createAnnotationLiteral(phaseEvent.getPhaseId(), false)).fire(phaseEvent);
    this.afterAnyPhaseEvent.fire(phaseEvent);

    //fire to ds-phase-listeners
    //call the listeners in reverse-order (like jsf)
    ListIterator<PhaseListener> phaseListenerIterator = this.phaseListeners.listIterator(phaseListeners.size());

    while (phaseListenerIterator.hasPrevious())
    {
        PhaseListener phaseListener = phaseListenerIterator.previous();
        PhaseId targetPhase = phaseListener.getPhaseId();

        if (targetPhase == PhaseId.ANY_PHASE || targetPhase == phaseEvent.getPhaseId())
        {
            phaseListener.afterPhase(phaseEvent);
        }
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:24,代碼來源:JsfRequestLifecycleBroadcaster.java

示例6: doPostBringupActions

import javax.faces.event.PhaseListener; //導入依賴的package包/類
public void doPostBringupActions() {

        if (deferredLoggingActions != null) {
            for (DeferredLoggingAction loggingAction : deferredLoggingActions) {
                loggingAction.log();
            }
        }

        // add the HttpMethodRestrictionPhaseListener if the parameter is enabled.
        boolean enabled = this.isOptionEnabled(BooleanWebContextInitParameter.EnableHttpMethodRestrictionPhaseListener);
        if (enabled) {
            LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
            Iterator<String> ids = factory.getLifecycleIds();
            PhaseListener listener = null;
            Lifecycle cur;

            while (ids.hasNext()) {
                cur = factory.getLifecycle(ids.next());
                boolean foundExistingListenerInstance = false;
                for (PhaseListener curListener : cur.getPhaseListeners()) {
                    if (curListener instanceof HttpMethodRestrictionsPhaseListener) {
                        foundExistingListenerInstance = true;
                        break;
                    }
                }
                if (!foundExistingListenerInstance) {
                    if (null == listener) {
                        listener = new HttpMethodRestrictionsPhaseListener();
                    }
                    cur.addPhaseListener(listener);
                }
            }
        }


    }
 
開發者ID:davidsedlar,項目名稱:SpIzracun,代碼行數:37,代碼來源:WebConfiguration.java

示例7: addPhaseListener

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Override
public void addPhaseListener(PhaseListener listener) {
    if (firstPhaseListener) {
        //forced order independent of any other config
        firstPhaseListener = false;
        wrapped.addPhaseListener(new ExtValStartupListener());
    }
    wrapped.addPhaseListener(listener);
}
 
開發者ID:apache,項目名稱:tomee,代碼行數:10,代碼來源:ExtValLifecycleFactory.java

示例8: sortDescending

import javax.faces.event.PhaseListener; //導入依賴的package包/類
private static void sortDescending(List<PhaseListener> phaseListeners)
{
    Collections.sort(phaseListeners, new Comparator<PhaseListener>()
    {
        @Override
        public int compare(PhaseListener phaseListener1, PhaseListener phaseListener2)
        {
            return (phaseListener1.getClass().getAnnotation(JsfPhaseListener.class).ordinal() >
                    phaseListener2.getClass().getAnnotation(JsfPhaseListener.class).ordinal()) ? -1 : 1;
        }
    });
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:13,代碼來源:JsfRequestLifecycleBroadcaster.java

示例9: addPhaseListener

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Override
public void addPhaseListener(PhaseListener newPhaseListener) {
    throw new UnsupportedOperationException();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:5,代碼來源:UIViewRootStub.java

示例10: removePhaseListener

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Override
public void removePhaseListener(PhaseListener toRemove) {
    throw new UnsupportedOperationException();
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:5,代碼來源:UIViewRootStub.java

示例11: beforePhase

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Override
public void beforePhase(PhaseEvent event) {
	for (PhaseListener listener : getDelegates(event.getFacesContext())) {
		listener.beforePhase(event);
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:DelegatingPhaseListenerMulticaster.java

示例12: afterPhase

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Override
public void afterPhase(PhaseEvent event) {
	for (PhaseListener listener : getDelegates(event.getFacesContext())) {
		listener.afterPhase(event);
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:DelegatingPhaseListenerMulticaster.java

示例13: addPhaseListener

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Override
public void addPhaseListener(PhaseListener phaseListener) {
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:4,代碼來源:MockLifecycle.java

示例14: getPhaseListeners

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Override
public PhaseListener[] getPhaseListeners() {
	return null;
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:5,代碼來源:MockLifecycle.java

示例15: removePhaseListener

import javax.faces.event.PhaseListener; //導入依賴的package包/類
@Override
public void removePhaseListener(PhaseListener phaseListener) {
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:4,代碼來源:MockLifecycle.java


注:本文中的javax.faces.event.PhaseListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。