Package de.xima.fc.listener
Class ReflectionListenerScanner
- java.lang.Object
-
- de.xima.fc.listener.ReflectionListenerScanner
-
public class ReflectionListenerScanner extends Object
Scanner that finds allIListenerRegistrator
implementations and registers them.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_MS_LISTENERS
static String
DEFAULT_WORKFLOW_LISTENERS
-
Constructor Summary
Constructors Constructor Description ReflectionListenerScanner()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
initialize(String listenerPackage)
Initializes all implementations ofIListenerRegistrator
found in the given package (and all sub packages).
-
-
-
Field Detail
-
DEFAULT_MS_LISTENERS
public static final String DEFAULT_MS_LISTENERS
- See Also:
- Constant Field Values
-
DEFAULT_WORKFLOW_LISTENERS
public static final String DEFAULT_WORKFLOW_LISTENERS
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public static void initialize(String listenerPackage)
Initializes all implementations ofIListenerRegistrator
found in the given package (and all sub packages). For each class that implementsIListenerRegistrator
, obtains an instance of that class, then calls theIListenerRegistrator.register()
. To obtain an instance, first check whether an accessible (public) static field namedINSTANCE
exists. Otherwise, checks whether an accessible (public) static method namedgetInstance
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 ofIListenerRegistrator
. Sub packages are included as well.
-
-