org.jboss.shrinkwrap.api
Interface ExtensionLoader


public interface ExtensionLoader

ExtensionLoader Describes a way for the Archive to load extensions. If an implementation is not set in the Domain's Configuration, ServiceExtensionLoader is set as the default strategy to load extensions.

Version:
$Revision: $
Author:
Aslak Knutsen, Ken Gullaksen

Method Summary
<T extends Assignable>
ExtensionLoader
addOverride(Class<T> extensionClass, Class<? extends T> extensionImplClass)
          Add a Override to the normal Extension loading.
<T extends Assignable>
String
getExtensionFromExtensionMapping(Class<T> extensionClass)
          Gets the extension for the given type from the extensionMapping
<T extends Assignable>
T
load(Class<T> extensionClass, Archive<?> baseArchive)
          Load a Extension.
 

Method Detail

load

<T extends Assignable> T load(Class<T> extensionClass,
                              Archive<?> baseArchive)
Load a Extension.

Type Parameters:
T -
Parameters:
extensionClass - The Extension interface
baseArchive - The base archive to use
Returns:
a

addOverride

<T extends Assignable> ExtensionLoader addOverride(Class<T> extensionClass,
                                                   Class<? extends T> extensionImplClass)
Add a Override to the normal Extension loading. If a specific class is found to be overridden, the class will not be loaded using the normal strategy.

Type Parameters:
T - The type of Extension
Parameters:
extensionClass - The Extension interface class
extensionImplClass - The Extension implementation class
Returns:
this ExtensionLoader

getExtensionFromExtensionMapping

<T extends Assignable> String getExtensionFromExtensionMapping(Class<T> extensionClass)
Gets the extension for the given type from the extensionMapping

Type Parameters:
T - The type of Extension
Parameters:
extensionClass - The Extension interface class
Returns:
the filename extension


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.