Package org.apache.openjpa.lib.util
Class Services
- java.lang.Object
- 
- org.apache.openjpa.lib.util.Services
 
- 
 public class Services extends java.lang.ObjectUtility classes to locate services, as defined in the Jar File Specification. Most of the methods in this class can also be found in the sun.misc.Service class, but since it is undocumented, we cannot rely on its API. Service location for a specified interface is done by searching for the resource /META-INF/services/service.class.name, and loading the resource. Methods in this class that do not declare exceptions will never throw Runtime exceptions: exceptions are silently swallowed and empty array values are returned.- Author:
- Marc Prud'hommeaux
 
- 
- 
Constructor SummaryConstructors Constructor Description Services()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class[]getImplementorClasses(java.lang.Class serviceClass)static java.lang.Class[]getImplementorClasses(java.lang.Class serviceClass, java.lang.ClassLoader loader)static java.lang.Class[]getImplementorClasses(java.lang.String serviceName)Return an array of Class objects of all known service implementors of the specified class name(as resolved by the current thread's context class loader).static java.lang.Class[]getImplementorClasses(java.lang.String serviceName, java.lang.ClassLoader loader)static java.lang.Class[]getImplementorClasses(java.lang.String serviceName, java.lang.ClassLoader loader, boolean skipMissing)Return an array of Class objects of all known service implementors of the specified class name, as resolved by the specifiedClassLoader.static java.lang.String[]getImplementors(java.lang.Class serviceClass)Return an array of Strings of class names of all known service implementors of the specified interface or class.static java.lang.String[]getImplementors(java.lang.Class serviceClass, java.lang.ClassLoader loader)Return an array of Strings of class names of all known service implementors of the specified interface or class.static java.lang.String[]getImplementors(java.lang.String serviceName)Return an array of Strings of class names of all known service implementors of the specified class name(as resolved by the current thread's context class loader).static java.lang.String[]getImplementors(java.lang.String serviceName, java.lang.ClassLoader loader)Return an array of Strings of class names of all known service implementors of the specified class name, as resolved by the specifiedClassLoader.
 
- 
- 
- 
Method Detail- 
getImplementorspublic static java.lang.String[] getImplementors(java.lang.Class serviceClass) Return an array of Strings of class names of all known service implementors of the specified interface or class.
 - 
getImplementorspublic static java.lang.String[] getImplementors(java.lang.Class serviceClass, java.lang.ClassLoader loader)Return an array of Strings of class names of all known service implementors of the specified interface or class.
 - 
getImplementorspublic static java.lang.String[] getImplementors(java.lang.String serviceName) Return an array of Strings of class names of all known service implementors of the specified class name(as resolved by the current thread's context class loader).
 - 
getImplementorspublic static java.lang.String[] getImplementors(java.lang.String serviceName, java.lang.ClassLoader loader)Return an array of Strings of class names of all known service implementors of the specified class name, as resolved by the specifiedClassLoader.
 - 
getImplementorClassespublic static java.lang.Class[] getImplementorClasses(java.lang.Class serviceClass) 
 - 
getImplementorClassespublic static java.lang.Class[] getImplementorClasses(java.lang.Class serviceClass, java.lang.ClassLoader loader)
 - 
getImplementorClassespublic static java.lang.Class[] getImplementorClasses(java.lang.String serviceName) Return an array of Class objects of all known service implementors of the specified class name(as resolved by the current thread's context class loader).
 - 
getImplementorClassespublic static java.lang.Class[] getImplementorClasses(java.lang.String serviceName, java.lang.ClassLoader loader)
 - 
getImplementorClassespublic static java.lang.Class[] getImplementorClasses(java.lang.String serviceName, java.lang.ClassLoader loader, boolean skipMissing) throws java.lang.ClassNotFoundExceptionReturn an array of Class objects of all known service implementors of the specified class name, as resolved by the specifiedClassLoader.- Parameters:
- skipMissing- if true, then ignore classes that cannot be loaded by the classloader; otherwise, resolution failures will throw a- ClassNotFoundException.
- Throws:
- java.lang.ClassNotFoundException
 
 
- 
 
-