org.glassfish.grizzly.servlet.WebappContext.getEventListeners()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(12.3k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.glassfish.grizzly.servlet.WebappContext.getEventListeners()方法的一些代码示例,展示了WebappContext.getEventListeners()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebappContext.getEventListeners()方法的具体详情如下:
包路径:org.glassfish.grizzly.servlet.WebappContext
类名称:WebappContext
方法名:getEventListeners

WebappContext.getEventListeners介绍

暂无

代码示例

代码示例来源:origin: javaee/grizzly

@Override
protected EventListener[] getEventListeners() {
  return super.getEventListeners();
}

代码示例来源:origin: javaee/grizzly

@Override
protected EventListener[] getEventListeners() {
  return super.getEventListeners();
}

代码示例来源:origin: javaee/grizzly

private void requestInitialized(ServletRequestEvent event) {
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestInitialized(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestDestroyed(ServletRequestEvent event) {
  // TODO don't create the event unless necessary
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestDestroyed(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestDestroyed(ServletRequestEvent event) {
  // TODO don't create the event unless necessary
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestDestroyed(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestInitialized(ServletRequestEvent event) {
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestInitialized(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestInitialized(ServletRequestEvent event) {
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestInitialized(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestInitialized(ServletRequestEvent event) {
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestInitialized(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestDestroyed(ServletRequestEvent event) {
  // TODO don't create the event unless necessary
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestDestroyed(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

private void requestInitialized(ServletRequestEvent event) {
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestInitialized(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestInitialized(ServletRequestEvent event) {
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestInitialized(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

private void requestDestroyed(ServletRequestEvent event) {
  // TODO don't create the event unless necessary
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestDestroyed(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestDestroyed(ServletRequestEvent event) {
  // TODO don't create the event unless necessary
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestDestroyed(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

private void requestDestroyed(ServletRequestEvent event) {
  // TODO don't create the event unless necessary
  final EventListener[] listeners = ctx.getEventListeners();
  for (int i = 0, len = listeners.length; i < len; i++) {
    if (listeners[i] instanceof ServletRequestListener) {
      try {
        ((ServletRequestListener) listeners[i]).requestDestroyed(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
              LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("requestDestroyed", "ServletRequestListener", listeners[i].getClass().getName()),
              t);
        }
      }
    }
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * Invoke to notify all registered {@link HttpSessionListener} of the 
 * session has just been created.
 */
protected void notifyNew() {
  EventListener[] listeners = contextImpl.getEventListeners();
  if (listeners.length > 0) {
    HttpSessionEvent event =
        new HttpSessionEvent(this);
    for (int i = 0, len = listeners.length; i < len; i++) {
      Object listenerObj = listeners[i];
      if (!(listenerObj instanceof HttpSessionListener)) {
        continue;
      }
      HttpSessionListener listener =
          (HttpSessionListener) listenerObj;
      try {
        listener.sessionCreated(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
                LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("sessionCreated", "HttpSessionListener", listener.getClass().getName()),
                t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * Invoke to notify all registered {@link HttpSessionListener} of the 
 * session has just been created.
 */
protected void notifyNew() {
  EventListener[] listeners = contextImpl.getEventListeners();
  if (listeners.length > 0) {
    HttpSessionEvent event =
        new HttpSessionEvent(this);
    for (int i = 0, len = listeners.length; i < len; i++) {
      Object listenerObj = listeners[i];
      if (!(listenerObj instanceof HttpSessionListener)) {
        continue;
      }
      HttpSessionListener listener =
          (HttpSessionListener) listenerObj;
      try {
        listener.sessionCreated(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
                LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("sessionCreated", "HttpSessionListener", listener.getClass().getName()),
                t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

/**
   * Invoke to notify all registered {@link HttpSessionListener} of the 
   * session has just been created.
   */
  protected void notifyIdChanged(final String oldId) {
    EventListener[] listeners = contextImpl.getEventListeners();
    if (listeners.length > 0) {
      HttpSessionEvent event =
          new HttpSessionEvent(this);
      for (int i = 0, len = listeners.length; i < len; i++) {
        Object listenerObj = listeners[i];
        if (!(listenerObj instanceof HttpSessionIdListener)) {
          continue;
        }
        HttpSessionIdListener listener =
            (HttpSessionIdListener) listenerObj;
        try {
          listener.sessionIdChanged(event, oldId);
        } catch (Throwable t) {
          if (LOGGER.isLoggable(Level.WARNING)) {
            LOGGER.log(Level.WARNING,
                  LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("sessionCreated", "HttpSessionListener", listener.getClass().getName()),
                  t);
          }
        }
      }
    }
  }    
}

代码示例来源:origin: javaee/grizzly

/**
   * Invoke to notify all registered {@link HttpSessionListener} of the 
   * session has just been created.
   */
  protected void notifyIdChanged(final String oldId) {
    EventListener[] listeners = contextImpl.getEventListeners();
    if (listeners.length > 0) {
      HttpSessionEvent event =
          new HttpSessionEvent(this);
      for (int i = 0, len = listeners.length; i < len; i++) {
        Object listenerObj = listeners[i];
        if (!(listenerObj instanceof HttpSessionIdListener)) {
          continue;
        }
        HttpSessionIdListener listener =
            (HttpSessionIdListener) listenerObj;
        try {
          listener.sessionIdChanged(event, oldId);
        } catch (Throwable t) {
          if (LOGGER.isLoggable(Level.WARNING)) {
            LOGGER.log(Level.WARNING,
                  LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("sessionCreated", "HttpSessionListener", listener.getClass().getName()),
                  t);
          }
        }
      }
    }
  }    
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public synchronized void invalidate() {
  session.setValid(false);
  session.attributes().clear();
  EventListener[] listeners = contextImpl.getEventListeners();
  if (listeners.length > 0) {
    HttpSessionEvent event =
        new HttpSessionEvent(this);
    for (int i = 0, len = listeners.length; i < len; i++) {
      Object listenerObj = listeners[i];
      if (!(listenerObj instanceof HttpSessionListener)) {
        continue;
      }
      HttpSessionListener listener =
          (HttpSessionListener) listenerObj;
      try {
        listener.sessionDestroyed(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
                LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("sessionDestroyed", "HttpSessionListener", listener.getClass().getName()),
                t);
        }
      }
    }
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public synchronized void invalidate() {
  session.setValid(false);
  session.attributes().clear();
  EventListener[] listeners = contextImpl.getEventListeners();
  if (listeners.length > 0) {
    HttpSessionEvent event =
        new HttpSessionEvent(this);
    for (int i = 0, len = listeners.length; i < len; i++) {
      Object listenerObj = listeners[i];
      if (!(listenerObj instanceof HttpSessionListener)) {
        continue;
      }
      HttpSessionListener listener =
          (HttpSessionListener) listenerObj;
      try {
        listener.sessionDestroyed(event);
      } catch (Throwable t) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING,
                LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("sessionDestroyed", "HttpSessionListener", listener.getClass().getName()),
                t);
        }
      }
    }
  }
}

相关文章

WebappContext类方法