code: @Override
      public <T extends EventListener> T  createListener(Class<T> classToCreate) throws ServletException {        
          boolean valid = false;
          
          T listener = super.createListener(classToCreate);
          
          for (Class c : validListenerClasses) {
              if (c != null && c.isAssignableFrom(classToCreate)) {
                  valid = true;
              }
          }
          
          if (!valid) {
              throw new IllegalArgumentException(nls.getString("exception.occurred.while.creating.listener.instance"));
          }
          
          return listener;
      }
docs: /*
  (non-Javadoc)
  @see com.ibm.ws.webcontainer.osgi.webapp.WebApp#createListener(java.lang.Class)