use of liquibase.exception.ServiceNotFoundException in project liquibase by liquibase.
the class ServiceLocator method findClasses.
public <T> Class<? extends T>[] findClasses(Class<T> requiredInterface) throws ServiceNotFoundException {
logger.debug("ServiceLocator.findClasses for " + requiredInterface.getName());
try {
Class.forName(requiredInterface.getName());
if (!classesBySuperclass.containsKey(requiredInterface)) {
classesBySuperclass.put(requiredInterface, findClassesImpl(requiredInterface));
}
} catch (Exception e) {
throw new ServiceNotFoundException(e);
}
List<Class> classes = classesBySuperclass.get(requiredInterface);
HashSet<Class> uniqueClasses = new HashSet<Class>(classes);
return uniqueClasses.toArray(new Class[uniqueClasses.size()]);
}
Aggregations