コード例 #1
0
  @Override
  public void processEvent(final SystemEvent event) throws AbortProcessingException {
    if (event instanceof PreDestroyApplicationEvent && !isBeanManagerAvailable()) {
      log.info(
          "BeanManager no longer available; Cannot notify CDI-managed listeners of "
              + PreDestroyApplicationEvent.class.getSimpleName());
      return;
    }

    for (SystemEventListener l : getEventListeners()) {
      if (l.isListenerForSource(event.getSource())) {
        l.processEvent(event);
      }
    }
  }
コード例 #2
0
  public void processEvent(SystemEvent cse) throws AbortProcessingException {
    AutoUpdatable component = (AutoUpdatable) cse.getSource();
    FacesContext context = FacesContext.getCurrentInstance();

    if (component.isAutoUpdate()
        && context.getRenderKit().getResponseStateManager().isPostback(context)) {

      Object ignoreAutoUpdateObject =
          context
              .getExternalContext()
              .getRequestParameterMap()
              .get(Constants.RequestParams.IGNORE_AUTO_UPDATE_PARAM);
      boolean ignoreAutoUpdate =
          (null != ignoreAutoUpdateObject && "true".equals(ignoreAutoUpdateObject)) ? true : false;

      if (!ignoreAutoUpdate) {
        context.getPartialViewContext().getRenderIds().add(component.getClientId(context));
      }
    }
  }
コード例 #3
0
 public void processEvent(SystemEvent event) throws AbortProcessingException {
   Map<String, Object> requestMap =
       FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
   String message = requestMap.get("message").toString();
   requestMap.put("message", message + " " + event.getClass().getName());
 }