Search in sources :

Example 1 with ServiceNotFoundException

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()]);
}
Also used : ServiceNotFoundException(liquibase.exception.ServiceNotFoundException) IOException(java.io.IOException) UnexpectedLiquibaseException(liquibase.exception.UnexpectedLiquibaseException) ServiceNotFoundException(liquibase.exception.ServiceNotFoundException)

Aggregations

IOException (java.io.IOException)1 ServiceNotFoundException (liquibase.exception.ServiceNotFoundException)1 UnexpectedLiquibaseException (liquibase.exception.UnexpectedLiquibaseException)1