Package mondrian.util
Class ServiceDiscovery<T>
java.lang.Object
mondrian.util.ServiceDiscovery<T>
Utility functions to discover Java services.
Java services are described in the JAR File Specification.
Based on the suggested file format, this class reads the service entries in a JAR file and discovers implementors of an interface.
- Author:
- Marc Batchelor
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ServiceDiscovery<T>
Creates a ServiceDiscovery.Returns a list of classes that implement the service.protected void
parseImplementor
(String clazz, ClassLoader cLoader, Set<Class<T>> uniqueClasses) Parses a list of classes that implement a service.
-
Method Details
-
forClass
Creates a ServiceDiscovery.- Parameters:
theInterface
- Interface for service- Returns:
- ServiceDiscovery for finding instances of the given interface
-
getImplementor
Returns a list of classes that implement the service.- Returns:
- List of classes that implement the service
-
parseImplementor
Parses a list of classes that implement a service.- Parameters:
clazz
- Class name (or list of class names)cLoader
- Class loaderuniqueClasses
- Set of classes (output)
-