public class AutoDiscovery
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static BaseMetaobjectProtocol[] |
discoverBaseMetaobjectProtocols()
Returns an instance of all metaobject protocol classes that are declared
in the /META-INF/services/org.dynalang.mop.BaseMetaobjectProtocol
resources of all JAR files in the current thread's context class loader's
classpath.
|
static BaseMetaobjectProtocol[] |
discoverBaseMetaobjectProtocols(java.lang.ClassLoader cl)
Returns an instance of all metaobject protocol classes that are declared
in the /META-INF/services/org.dynalang.mop.BaseMetaobjectProtocol
resources of all JAR files in the specified class loader's classpath.
|
public static BaseMetaobjectProtocol[] discoverBaseMetaobjectProtocols() throws java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
MetaobjectProtocolAdaptor.toMetaobjectProtocols(BaseMetaobjectProtocol[])
if your code uses the full MOP interface instead of the base one.java.io.IOException - if there is a problem reading classpath resourcesjava.lang.InstantiationException - if a class declared in a service list can
not be instantiatedjava.lang.IllegalAccessException - if a class declared in a service list is
not public or does not have a publicly visible default constructorjava.lang.ClassNotFoundException - if a class declared in a service list is
not foundjava.lang.ClassCastException - if a class declared in a service list does
not implement the BaseMetaobjectProtocol interface.public static BaseMetaobjectProtocol[] discoverBaseMetaobjectProtocols(java.lang.ClassLoader cl) throws java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
cl - the class loader within which the MOPs are discovered. null
can be used to denote the system class loader.MetaobjectProtocolAdaptor.toMetaobjectProtocols(BaseMetaobjectProtocol[])
if your code uses the full MOP interface instead of the base one.java.io.IOException - if there is a problem reading classpath resourcesjava.lang.InstantiationException - if a class declared in a service list can
not be instantiatedjava.lang.IllegalAccessException - if a class declared in a service list is
not public or does not have a publicly visible default constructorjava.lang.ClassNotFoundException - if a class declared in a service list is
not foundjava.lang.ClassCastException - if a class declared in a service list does
not implement the BaseMetaobjectProtocol interface.