Package net.ontopia.utils
Class ServiceUtils
- java.lang.Object
-
- net.ontopia.utils.ServiceUtils
-
public class ServiceUtils extends Object
Utility to load dynamic services from classpath.- Since:
- 5.4.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
SERVICES_ROOT
-
Constructor Summary
Constructors Constructor Description ServiceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Set<T>
loadServices(Class<T> clazz)
Calls#loadServices(java.lang.Class, java.lang.String)
with resource as the default location: META-INF/services/[classname].
-
-
-
Field Detail
-
SERVICES_ROOT
public static final String SERVICES_ROOT
- See Also:
- Constant Field Values
-
-
Method Detail
-
loadServices
public static <T> Set<T> loadServices(Class<T> clazz) throws IOException
Calls#loadServices(java.lang.Class, java.lang.String)
with resource as the default location: META-INF/services/[classname].- Type Parameters:
T
- The type of the services to load- Parameters:
clazz
- The class that the services have to implement- Returns:
- The service instances found on the classpath
- Throws:
IOException
-
-