public final void registerEventClass ( String eventType , Class < ? extends ManagerEvent > clazz ) throws IllegalArgumentException { Constructor < ? > defaultConstructor ; if ( ! ManagerEvent . class . isAssignableFrom ( clazz ) ) { throw new IllegalArgumentException ( clazz + " is not a ManagerEvent" ) ; } if ( ( clazz . getModifiers ( ) & Modifier . ABSTRACT ) != 0 ) { throw new IllegalArgumentException ( clazz + " is abstract" ) ; } try { defaultConstructor = clazz . getConstructor ( Object . class ) ; } catch ( NoSuchMethodException ex ) { throw new IllegalArgumentException ( clazz + " has no usable constructor" ) ; } if ( ( defaultConstructor . getModifiers ( ) & Modifier . PUBLIC ) == 0 ) { throw new IllegalArgumentException ( clazz + " has no public default constructor" ) ; } registeredEventClasses . put ( eventType . toLowerCase ( Locale . US ) , clazz ) ; logger . debug ( "Registered event type '" + eventType + "' (" + clazz + ")" ) ; }
Registers a new event class for the event given by eventType .