Class ReflectionListenerScanner

java.lang.Object
de.xima.fc.listener.ReflectionListenerScanner

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

  • Constructor Details

    • ReflectionListenerScanner

      public ReflectionListenerScanner()
  • Method Details

    • 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.