@SuppressWarnings({ "unchecked", "rawtypes" })
  private EventDispatcher getEventDispatcher(Class<?> eventType, boolean createIfNotExists) {

    EventDispatcher<?> dispatcher = this.eventType2dispatcherMap.get(eventType);
    if (dispatcher == null) {
      Class<?> parentType = eventType.getSuperclass();
      if (createIfNotExists) {
        EventDispatcher<?> parent;
        if (parentType == null) {
          assert (eventType == Object.class);
          parent = null;
        } else {
          parent = getEventDispatcher(parentType, true);
        }
        dispatcher = new EventDispatcher(parent, this.queueFactory);
        this.eventType2dispatcherMap.put(eventType, dispatcher);
      } else {
        return getEventDispatcher(parentType, false);
      }
    }
    return dispatcher;
  }
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) private EventDispatcher getEventDispatcher ( Class < ? > eventType , boolean createIfNotExists ) { EventDispatcher < ? > dispatcher = this . eventType2dispatcherMap . get ( eventType ) ; if ( dispatcher == null ) { Class < ? > parentType = eventType . getSuperclass ( ) ; if ( createIfNotExists ) { EventDispatcher < ? > parent ; if ( parentType == null ) { assert ( eventType == Object . class ) ; parent = null ; } else { parent = getEventDispatcher ( parentType , true ) ; } dispatcher = new EventDispatcher ( parent , this . queueFactory ) ; this . eventType2dispatcherMap . put ( eventType , dispatcher ) ; } else { return getEventDispatcher ( parentType , false ) ; } } return dispatcher ; }
Gets or creates the {@link EventDispatcher} for the given {@code eventType}.

@param eventType is the {@link Class} reflecting the {@link net.sf.mmm.util.event.api.Event event}.
@param createIfNotExists - if {@code true} the requested {@link EventDispatcher} will be created if it does not
exists, if {@code false} this method will return {@code null} if it does not exist.
@return the {@link EventDispatcher} responsible for the given {@code eventType}. May be {@code null} if
{@code createIfNotExists} is {@code null} and not available.