Class SPInterface
- java.lang.Object
-
- org.apache.commons.discovery.tools.SPInterface
-
public class SPInterface extends java.lang.ObjectRepresents a Service Programming Interface (spi). - SPI's name - SPI's (provider) class - SPI's (alternate) override property name In addition, while there are many cases where this is NOT usefull, for those in which it is: - expected constructor argument types and parameters values.- Author:
- Richard A. Sitze
-
-
Constructor Summary
Constructors Constructor Description SPInterface(java.lang.Class provider)Construct object representing Classprovider.SPInterface(java.lang.Class provider, java.lang.Class[] constructorParamClasses, java.lang.Object[] constructorParams)Construct object representing Classprovider.SPInterface(java.lang.Class spi, java.lang.String propertyName)Construct object representing Classprovider.SPInterface(java.lang.Class spi, java.lang.String propertyName, java.lang.Class[] constructorParamClasses, java.lang.Object[] constructorParams)Construct object representing Classprovider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetPropertyName()java.lang.ClassgetSPClass()java.lang.StringgetSPName()java.lang.ObjectnewInstance(java.lang.Class impl)Instantiate a newvoidverifyAncestory(java.lang.Class impl)
-
-
-
Constructor Detail
-
SPInterface
public SPInterface(java.lang.Class provider)
Construct object representing Classprovider.- Parameters:
provider- The SPI class
-
SPInterface
public SPInterface(java.lang.Class spi, java.lang.String propertyName)Construct object representing Classprovider.- Parameters:
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 thepropertyName.
-
SPInterface
public SPInterface(java.lang.Class provider, java.lang.Class[] constructorParamClasses, java.lang.Object[] constructorParams)Construct object representing Classprovider.- Parameters:
provider- The SPI classconstructorParamClasses- classes representing the constructor argument types.constructorParams- objects representing the constructor arguments.
-
SPInterface
public SPInterface(java.lang.Class spi, java.lang.String propertyName, java.lang.Class[] constructorParamClasses, java.lang.Object[] constructorParams)Construct object representing Classprovider.- Parameters:
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 thepropertyName.constructorParamClasses- classes representing the constructor argument types.constructorParams- objects representing the constructor arguments.
-
-
Method Detail
-
getSPName
public java.lang.String getSPName()
-
getSPClass
public java.lang.Class getSPClass()
-
getPropertyName
public java.lang.String getPropertyName()
-
newInstance
public java.lang.Object newInstance(java.lang.Class impl) throws DiscoveryException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetExceptionInstantiate a new- Throws:
DiscoveryExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.NoSuchMethodExceptionjava.lang.reflect.InvocationTargetException
-
verifyAncestory
public void verifyAncestory(java.lang.Class impl)
-
-