Package de.xima.fc.listener
Class ReflectionListenerScanner
- java.lang.Object
-
- de.xima.fc.listener.ReflectionListenerScanner
-
public class ReflectionListenerScanner extends Object
Scanner that finds allIListenerRegistratorimplementations and registers them.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_MS_LISTENERSstatic StringDEFAULT_WORKFLOW_LISTENERS
-
Constructor Summary
Constructors Constructor Description ReflectionListenerScanner()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidinitialize(String listenerPackage)Initializes all implementations ofIListenerRegistratorfound 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 ofIListenerRegistratorfound 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 namedINSTANCEexists. Otherwise, checks whether an accessible (public) static method namedgetInstanceexists. 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.
-
-