T
- The SPI typepublic class SPInterface<T> extends Object
Constructor and Description |
---|
SPInterface(Class<T> provider)
Construct object representing Class
provider . |
SPInterface(Class<T> provider,
Class<?>[] constructorParamClasses,
Object[] constructorParams)
Construct object representing Class
provider . |
SPInterface(Class<T> spi,
String propertyName)
Construct object representing Class
provider . |
SPInterface(Class<T> spi,
String propertyName,
Class<?>[] constructorParamClasses,
Object[] constructorParams)
Construct object representing Class
provider . |
Modifier and Type | Method and Description |
---|---|
String |
getPropertyName()
Returns the property name to be used for finding
the name of the SPI implementation class.
|
Class<T> |
getSPClass()
Returns the SPI class.
|
String |
getSPName()
Returns the SPI class name.
|
<S extends T> |
newInstance(Class<S> impl)
Creates a new instance of the given SPI class.
|
static <T> SPInterface<T> |
newSPInterface(Class<T> provider)
Construct object representing Class
provider . |
static <T> SPInterface<T> |
newSPInterface(Class<T> provider,
Class<?>[] constructorParamClasses,
Object[] constructorParams)
Construct object representing Class
provider . |
static <T> SPInterface<T> |
newSPInterface(Class<T> provider,
String propertyName)
Construct object representing Class
provider . |
static <T> SPInterface<T> |
newSPInterface(Class<T> provider,
String propertyName,
Class<?>[] constructorParamClasses,
Object[] constructorParams)
Construct object representing Class
provider . |
<S extends T> |
verifyAncestory(Class<S> impl)
Verifies the given SPI implementation is a SPI specialization.
|
public SPInterface(Class<T> provider)
provider
.provider
- The SPI classpublic SPInterface(Class<T> spi, String propertyName)
provider
.spi
- The SPI classpropertyName
- when looking for the name of a class implementing
the provider class, a discovery strategy may involve looking for
(system or other) properties having either the name of the class
(provider) or the propertyName
.public SPInterface(Class<T> provider, Class<?>[] constructorParamClasses, Object[] constructorParams)
provider
.provider
- The SPI classconstructorParamClasses
- classes representing the
constructor argument types.constructorParams
- objects representing the
constructor arguments.public SPInterface(Class<T> spi, String propertyName, Class<?>[] constructorParamClasses, Object[] constructorParams)
provider
.spi
- The SPI classpropertyName
- when looking for the name of a class implementing
the provider class, a discovery strategy may involve looking for
(system or other) properties having either the name of the class
(provider) or the propertyName
.constructorParamClasses
- classes representing the
constructor argument types.constructorParams
- objects representing the
constructor arguments.public static <T> SPInterface<T> newSPInterface(Class<T> provider)
provider
.T
- The SPI typeprovider
- The SPI classprovider
public static <T> SPInterface<T> newSPInterface(Class<T> provider, String propertyName)
provider
.T
- The SPI typeprovider
- The SPI classpropertyName
- when looking for the name of a class implementing
the provider class, a discovery strategy may involve looking for
(system or other) properties having either the name of the class
(provider) or the propertyName
.provider
public static <T> SPInterface<T> newSPInterface(Class<T> provider, Class<?>[] constructorParamClasses, Object[] constructorParams)
provider
.T
- The SPI typeprovider
- The SPI classconstructorParamClasses
- classes representing the
constructor argument typesconstructorParams
- objects representing the
constructor argumentsprovider
public static <T> SPInterface<T> newSPInterface(Class<T> provider, String propertyName, Class<?>[] constructorParamClasses, Object[] constructorParams)
provider
.T
- The SPI typeprovider
- The SPI classpropertyName
- when looking for the name of a class implementing
the provider class, a discovery strategy may involve looking for
(system or other) properties having either the name of the class
(provider) or the propertyName
.constructorParamClasses
- classes representing the
constructor argument typesconstructorParams
- objects representing the
constructor argumentsprovider
public String getSPName()
public String getPropertyName()
public <S extends T> S newInstance(Class<S> impl) throws DiscoveryException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
S
- Any type extends Timpl
- The SPI class has to be instantiatedDiscoveryException
- if the class implementing
the SPI cannot be found, cannot be loaded and
instantiated, or if the resulting class does not implement
(or extend) the SPIInstantiationException
- see Class.newInstance()
IllegalAccessException
- see Class.newInstance()
NoSuchMethodException
- see Class.newInstance()
InvocationTargetException
- see Class.newInstance()
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.