Package de.xima.fc.listener
Class ReflectionListenerScanner
java.lang.Object
de.xima.fc.listener.ReflectionListenerScanner
Scanner that finds all
IListenerRegistrator implementations and registers them.- Author:
- XIMA MEDIA GmbH
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinitialize(String listenerPackage) Initializes all implementations ofIListenerRegistratorfound in the given package (and all sub packages).
-
Field Details
-
DEFAULT_MS_LISTENERS
- See Also:
-
DEFAULT_WORKFLOW_LISTENERS
- See Also:
-
-
Constructor Details
-
ReflectionListenerScanner
public ReflectionListenerScanner()
-
-
Method Details
-
initialize
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.
-