code: public void addCmsEventListener(I_CmsEventListener listener, int[] eventTypes) {
  
          synchronized (m_eventListeners) {
              if (eventTypes == null) {
                  // no event types given - register the listener for all event types
                  eventTypes = new int[] {I_CmsEventListener.LISTENERS_FOR_ALL_EVENTS.intValue()};
              }
              for (int i = 0; i < eventTypes.length; i++) {
                  // register the listener for all configured event types
                  Integer eventType = new Integer(eventTypes[i]);
                  List<I_CmsEventListener> listeners = m_eventListeners.get(eventType);
                  if (listeners == null) {
                      listeners = new ArrayList<I_CmsEventListener>();
                      m_eventListeners.put(eventType, listeners);
                  }
                  if (!listeners.contains(listener)) {
                      // add listerner only if it is not already registered
                      listeners.add(listener);
                  }
              }
          }
      }
docs: Add an OpenCms event listener.<p>
  
  @param listener the listener to add
  @param eventTypes the events to listen for