public class ServiceExtensionLoader extends Object implements ExtensionLoader
ExtensionLoader
is not provided to
the ConfigurationBuilder
and the ConfigurationBuilder.build()
method is invoked. If the
ConfigurationBuilder
doesn't provide any ClassLoader
, ConfigurationBuilder.build()
defaults
to a one-element collection holding the TCCL. The classLoaders
are used to find the
provider-configuration file for the extension to be loaded in META-INF/services/. This provider-configuration file is
used to make an instance of the SPI implementation and cached in cache
.Constructor and Description |
---|
ServiceExtensionLoader(Iterable<ClassLoader> classLoaders)
Creates a new instance, using the specified
ClassLoader s to create extensions |
Modifier and Type | Method and Description |
---|---|
<T extends Assignable> |
addOverride(Class<T> extensionClass,
Class<? extends T> extensionImplClass) |
<T extends Archive<T>> |
getArchiveFormatFromExtensionMapping(Class<T> type) |
<T extends Assignable> |
getExtensionFromExtensionMapping(Class<T> type) |
boolean |
isOverriden(Class<?> extensionClass)
Check to see if a specific extension interface is beeing overloaded
|
<T extends Assignable> |
load(Class<T> extensionClass,
Archive<?> baseArchive) |
public ServiceExtensionLoader(Iterable<ClassLoader> classLoaders) throws IllegalArgumentException
ClassLoader
s to create extensionsclassLoaders
- IllegalArgumentException
- If the ClassLoader
is not specifiedpublic <T extends Assignable> T load(Class<T> extensionClass, Archive<?> baseArchive) throws UnknownExtensionTypeException
load
in interface ExtensionLoader
UnknownExtensionTypeException
ExtensionLoader.load(java.lang.Class, org.jboss.shrinkwrap.api.Archive)
public <T extends Assignable> ServiceExtensionLoader addOverride(Class<T> extensionClass, Class<? extends T> extensionImplClass)
addOverride
in interface ExtensionLoader
ExtensionLoader.addOverride(java.lang.Class, java.lang.Class)
public <T extends Assignable> String getExtensionFromExtensionMapping(Class<T> type)
getExtensionFromExtensionMapping
in interface ExtensionLoader
ExtensionLoader.getExtensionFromExtensionMapping(java.lang.Class)
public <T extends Archive<T>> ArchiveFormat getArchiveFormatFromExtensionMapping(Class<T> type)
getArchiveFormatFromExtensionMapping
in interface ExtensionLoader
ExtensionLoader.getArchiveFormatFromExtensionMapping(java.lang.Class)
public boolean isOverriden(Class<?> extensionClass)
extensionClass
- The ExtensionType interface classCopyright © 2013 JBoss by Red Hat. All Rights Reserved.