Class ReflectionListenerScanner


  • public class ReflectionListenerScanner
    extends Object
    Scanner that finds all IListenerRegistrator implementations and registers them.
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • ReflectionListenerScanner

        public ReflectionListenerScanner()
    • Method Detail

      • initialize

        public static void initialize​(String listenerPackage)
        Initializes all implementations of IListenerRegistrator found in the given package (and all sub packages). For each class that implements IListenerRegistrator, obtains an instance of that class, then calls the IListenerRegistrator.register(). To obtain an instance, first check whether an accessible (public) static field named INSTANCE exists. Otherwise, checks whether an accessible (public) static method named getInstance exists. Otherwise, checks whether an accessible (public) no-arg constructor exists. When none of these exists, logs an error and skips the listener.
        Parameters:
        listenerPackage - Package name that is scanned for implementations of IListenerRegistrator. Sub packages are included as well.