public class ELKIServiceRegistry extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
ELKIServiceRegistry.Entry
Entry in the service registry.
|
Modifier and Type | Field and Description |
---|---|
private static URLClassLoader |
CLASSLOADER
Class loader
|
private static Map<Class<?>,ELKIServiceRegistry.Entry> |
data
Registry data.
|
static String |
FACTORY_POSTFIX
Factory class postfix.
|
(package private) static Class<?> |
FAILED_LOAD
Value to abuse for failures.
|
private static Logging |
LOG
Class logger.
|
Modifier | Constructor and Description |
---|---|
private |
ELKIServiceRegistry()
Do not use constructor.
|
Modifier and Type | Method and Description |
---|---|
protected static boolean |
contains(Class<?> c)
Test if a registry entry has already been created.
|
static List<Class<?>> |
findAllImplementations(Class<?> restrictionClass)
Find all implementations of a particular interface.
|
static List<Class<?>> |
findAllImplementations(Class<?> c,
boolean everything,
boolean parameterizable)
Find all implementations of a given class in the classpath.
|
static <C> Class<? extends C> |
findImplementation(Class<? super C> restrictionClass,
String value)
Find an implementation of the given interface / super class, given a
relative class name or alias name.
|
protected static void |
register(Class<?> parent,
Class<?> clazz)
Register a class in the registry.
|
protected static void |
register(Class<?> parent,
String cname)
Register a class with the registry.
|
protected static void |
registerAlias(Class<?> parent,
String alias,
String cname)
Register a class alias with the registry.
|
private static Class<?> |
tryLoadClass(String value)
Attempt to load a class
|
private static final Logging LOG
private static final URLClassLoader CLASSLOADER
public static final String FACTORY_POSTFIX
private static Map<Class<?>,ELKIServiceRegistry.Entry> data
static final Class<?> FAILED_LOAD
protected static void register(Class<?> parent, String cname)
parent
- Parent classcname
- Class nameprotected static void register(Class<?> parent, Class<?> clazz)
parent
- Classclazz
- Implementationprotected static void registerAlias(Class<?> parent, String alias, String cname)
parent
- Parent classalias
- Alias namecname
- Class nameprivate static Class<?> tryLoadClass(String value)
value
- Class name to try.null
.protected static boolean contains(Class<?> c)
c
- Classtrue
if a registry entry has been created.public static List<Class<?>> findAllImplementations(Class<?> restrictionClass)
restrictionClass
- Class to scan forpublic static List<Class<?>> findAllImplementations(Class<?> c, boolean everything, boolean parameterizable)
c
- Class restrictioneverything
- include interfaces, abstract and private classesparameterizable
- only return classes instantiable by the
parameterizable APIpublic static <C> Class<? extends C> findImplementation(Class<? super C> restrictionClass, String value)
restrictionClass
- Restriction classvalue
- Class name, relative class name, or nickname.null
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.