java.lang.Object
org.elasticsearch.plugins.spi.SPIClassIterator<S>
Helper class for loading SPI classes from classpath (META-INF files).
This is a light impl of
ServiceLoader but is guaranteed to
be bug-free regarding classpath order and does not instantiate or initialize
the classes found.-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> SPIClassIterator<S> Creates a new SPI iterator to lookup services of typeclazzusing the sameClassLoaderas the argument.static <S> SPIClassIterator<S> get(Class<S> clazz, ClassLoader loader) Creates a new SPI iterator to lookup services of typeclazzusing the given classloader.booleanhasNext()static booleanisParentClassLoader(ClassLoader parent, ClassLoader child) Utility method to check if some class loader is a (grand-)parent of or the same as another one.next()voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
get
Creates a new SPI iterator to lookup services of typeclazzusing the sameClassLoaderas the argument. -
get
Creates a new SPI iterator to lookup services of typeclazzusing the given classloader. -
isParentClassLoader
Utility method to check if some class loader is a (grand-)parent of or the same as another one. This means the child will be able to load all classes from the parent, too.If caller's codesource doesn't have enough permissions to do the check,
falseis returned (this is fine, because if we get aSecurityExceptionit is for sure no parent). -
hasNext
public boolean hasNext() -
next
-
remove
public void remove()
-