docs: @Override
      public void commonAddListener(String listenerClassName, EventListener listener,
                                    Class<? extends EventListener> listenerClass) {
          
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
              logger.entering(CLASS_NAME, "commonAddListener : listenerClassName = " + listenerClassName  
                                                               + ", listener = " + (listener==null ? "null" : listener.getClass().getName()) 
                                                               + ", listenerClass = " + (listenerClass==null ? "null" : listenerClass.getName()));
          if (initialized) {
              throw new IllegalStateException(liberty_nls.getString("Not.in.servletContextCreated"));
          }
          if (withinContextInitOfProgAddListener) {
              throw new UnsupportedOperationException(nls.getString("Unsupported.op.from.servlet.context.listener"));
          }
          if (com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping()) {
              return;
          }
          Class className = listenerClass;
          try {
              if (listenerClassName != null) {
                  className = Class.forName(listenerClassName, true, this.getClassLoader());
              } else if (listener != null) {
                  className = listener.getClass();
              }
              Class[] validListenerClasses = new Class[7];
              validListenerClasses[0] = javax.servlet.ServletContextAttributeListener.class;
              validListenerClasses[1] = javax.servlet.ServletRequestListener.class;
              validListenerClasses[2] = javax.servlet.ServletRequestAttributeListener.class;
              validListenerClasses[3] = javax.servlet.http.HttpSessionListener.class;
              validListenerClasses[4] = javax.servlet.http.HttpSessionAttributeListener.class;
              validListenerClasses[5] = javax.servlet.http.HttpSessionIdListener.class;
  
  
                  //if this was called from ServletContainerInitializer#onStartup, then the listener can implement ServletContextListener
              if (canAddServletContextListener) { // changed to protected scope in parent
                  validListenerClasses[6] = javax.servlet.ServletContextListener.class;
              } else {
                  if ((javax.servlet.ServletContextListener.class).isAssignableFrom(className)) {
                      throw new IllegalArgumentException(nls.getString("Error.adding.ServletContextListener"));
                  }
              }
              boolean valid = false;
              Set classesSet = new HashSet();
              for (Class c : validListenerClasses) {
                  if (c != null && c.isAssignableFrom(className)) {
                      valid = true;
                      classesSet.add(c);
                  }
              }
              if (!valid) {
                  throw new IllegalArgumentException(nls.getString("Invalid.Listener"));
              }
  
              if (listener == null) {
                  //processDynamicInjectionMetaData(null, className);
  
                  // Class or className was passed, need to create an instance
                  // Injection done here
                  try {
                      listener = createListener(className);
                  } catch (Exception e) {
                          logger.logp(Level.SEVERE, CLASS_NAME, "commonAddListener", "exception.occurred.while.creating.listener.instance", new Object[] {
                                  className, e });
                  }
              }
              // add it to the end of the ordered list of listeners
              if (classesSet.contains(javax.servlet.ServletContextAttributeListener.class)) {
                  this.servletContextLAttrListeners.add(listener);
              }
              if (classesSet.contains(javax.servlet.ServletRequestListener.class)) {
                  this.servletRequestListeners.add(listener);
              }
              if (classesSet.contains(javax.servlet.ServletRequestAttributeListener.class)) {
                  this.servletRequestLAttrListeners.add(listener);
              }
              if (classesSet.contains(javax.servlet.http.HttpSessionListener.class)) {
                      this.sessionListeners.add(listener);//add to this list in case we need to do a preDestroy
                      // No need to to HttpSessionListeners if the sessionContext is null because
                      // it will be added when the session context is created.
                      if (this.getSessionContext()!=null)
                          this.addHttpSessionListener((HttpSessionListener) listener, false);
              }
              if (classesSet.contains(javax.servlet.http.HttpSessionAttributeListener.class)) {
                          sessionAttrListeners.add(listener);//add to this list in case we need to do a preDestroy
                  this.addHttpSessionAttributeListener((HttpSessionAttributeListener) listener);
              }
              // Added for Servlet 3.1 HttpSessionIdListener support
              if (classesSet.contains(javax.servlet.http.HttpSessionIdListener.class)) {
                  sessionIdListeners.add(listener);//add to this list in case we need to do a preDestroy
                  this.addHttpSessionIdListener((HttpSessionIdListener) listener);
              }
              if (classesSet.contains(javax.servlet.ServletContextListener.class)) {
                  this.servletContextListeners.add(listener);
              }
          } catch (ClassNotFoundException e) {
              // This method can be called from addListener(String) which calls this method with a null
              // value for listenerClass, in turn if a ClassNotFoundException occurs the className is also null 
              // as className is set to = listenerClass before calling Class.forName which can throw the ClassNotFoundException.
              // Due to className having the possibility of being null we can't log className.getName() as an NPE will occur. Also
              // we should be logging listenerClassName as that is the listenerClassName that could not be found.
              logger.logp(Level.SEVERE, CLASS_NAME, "commonAddListener", 
                          "exception.occurred.while.adding.listener", new Object[] {listenerClassName});
          }
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
              logger.exiting(CLASS_NAME, "commomAddListener");
          
      }