| java.lang.Object org.apache.beehive.netui.util.internal.DiscoveryUtils
DiscoveryUtils | public class DiscoveryUtils (Code) | | Utility methods for discovering implementor classes on the classpath. An implementor class is declared in the
standard way, in a file within META-INF/services where the file name is the class name of the desired interface, and
the file contains the class name of the implementation. For example, to declare test.MyServiceImpl as a
test.MyService implementation, the file META-INF/services/test.MyService is put on classpath (e.g., in a JAR),
with contents "test.MyServiceImpl".
|
Method Summary | |
public static ClassLoader | getClassLoader() Get the ClassLoader from which implementor classes will be discovered and loaded. | public static Class[] | getImplementorClasses(Class interfaceType) Get all implementor classes (on the context classpath) that implement a given interface.
Parameters: interfaceType - the Class that represents the interface. | public static Class | loadImplementorClass(String className, Class interfaceType) Load an implementor class from the context classloader.
Parameters: className - the name of the implementor class. Parameters: interfaceType - the interface that the given class should implement. | public static Object | newImplementorInstance(String className, Class interfaceType) |
getClassLoader | public static ClassLoader getClassLoader()(Code) | | Get the ClassLoader from which implementor classes will be discovered and loaded.
|
getImplementorClasses | public static Class[] getImplementorClasses(Class interfaceType)(Code) | | Get all implementor classes (on the context classpath) that implement a given interface.
Parameters: interfaceType - the Class that represents the interface. an array of Classes that are implementations of interfaceType . |
loadImplementorClass | public static Class loadImplementorClass(String className, Class interfaceType)(Code) | | Load an implementor class from the context classloader.
Parameters: className - the name of the implementor class. Parameters: interfaceType - the interface that the given class should implement. the implementor Class, or null if an error occurred (the error will be logged). |
|
|