Search in sources :

Example 1 with UserSystemService

use of org.kie.server.services.taskassigning.user.system.api.UserSystemService in project droolsjbpm-integration by kiegroup.

the class UserSystemServiceLoader method loadServices.

public static Map<String, UserSystemService> loadServices(ClassLoader cl) {
    final Map<String, UserSystemService> result = new HashMap<>();
    final ServiceLoader<UserSystemService> availableServices = ServiceLoader.load(UserSystemService.class, cl);
    for (UserSystemService service : availableServices) {
        Object existed = result.putIfAbsent(service.getName(), service);
        if (existed == null) {
            LOGGER.debug("UserSystemService {} was added to the result", service.getName());
        } else {
            LOGGER.warn("UserSystemService {} was already added to the result, this another instance will be discarded.", service);
        }
    }
    return result;
}
Also used : HashMap(java.util.HashMap) UserSystemService(org.kie.server.services.taskassigning.user.system.api.UserSystemService)

Aggregations

HashMap (java.util.HashMap)1 UserSystemService (org.kie.server.services.taskassigning.user.system.api.UserSystemService)1