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)
Add a Override to the normal Extension loading.
|
<T extends Archive<T>> |
getArchiveFormatFromExtensionMapping(Class<T> type)
Gets the
ArchiveFormat for the given type from the extensionMapping |
<T extends Assignable> |
getExtensionFromExtensionMapping(Class<T> type)
Gets the extension for the given type from the extensionMapping
|
boolean |
isOverriden(Class<?> extensionClass)
Check to see if a specific extension interface is beeing overloaded
|
<T extends Assignable> |
load(Class<T> extensionClass,
Archive<?> baseArchive)
Load a Extension.
|
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
extensionClass
- The Extension interfacebaseArchive
- The base archive to useUnknownExtensionTypeException
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
T
- The type of ExtensionextensionClass
- The Extension interface classextensionImplClass
- The Extension implementation classExtensionLoader.addOverride(java.lang.Class, java.lang.Class)
public <T extends Assignable> String getExtensionFromExtensionMapping(Class<T> type)
getExtensionFromExtensionMapping
in interface ExtensionLoader
T
- The type of Extensiontype
- The Extension interface classExtensionLoader.getExtensionFromExtensionMapping(java.lang.Class)
public <T extends Archive<T>> ArchiveFormat getArchiveFormatFromExtensionMapping(Class<T> type)
ArchiveFormat
for the given type from the extensionMappinggetArchiveFormatFromExtensionMapping
in interface ExtensionLoader
T
- The type of Extensiontype
- The Extension interface classExtensionLoader.getArchiveFormatFromExtensionMapping(java.lang.Class)
public boolean isOverriden(Class<?> extensionClass)
extensionClass
- The ExtensionType interface classCopyright © 2016 JBoss by Red Hat. All rights reserved.