org.apache.commons.discovery.tools
Class SPInterface

java.lang.Object
  extended by org.apache.commons.discovery.tools.SPInterface

public class SPInterface
extends Object

Represents 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
SPInterface(Class provider)
          Construct object representing Class provider.
SPInterface(Class provider, Class[] constructorParamClasses, Object[] constructorParams)
          Construct object representing Class provider.
SPInterface(Class spi, String propertyName)
          Construct object representing Class provider.
SPInterface(Class spi, String propertyName, Class[] constructorParamClasses, Object[] constructorParams)
          Construct object representing Class provider.
 
Method Summary
 String getPropertyName()
           
 Class getSPClass()
           
 String getSPName()
           
 Object newInstance(Class impl)
          Instantiate a new
 void verifyAncestory(Class impl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPInterface

public SPInterface(Class provider)
Construct object representing Class provider.

Parameters:
provider - The SPI class

SPInterface

public SPInterface(Class spi,
                   String propertyName)
Construct object representing Class provider.

Parameters:
spi - The SPI class
propertyName - 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.

SPInterface

public SPInterface(Class provider,
                   Class[] constructorParamClasses,
                   Object[] constructorParams)
Construct object representing Class provider.

Parameters:
provider - The SPI class
constructorParamClasses - classes representing the constructor argument types.
constructorParams - objects representing the constructor arguments.

SPInterface

public SPInterface(Class spi,
                   String propertyName,
                   Class[] constructorParamClasses,
                   Object[] constructorParams)
Construct object representing Class provider.

Parameters:
spi - The SPI class
propertyName - 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.
Method Detail

getSPName

public String getSPName()

getSPClass

public Class getSPClass()

getPropertyName

public String getPropertyName()

newInstance

public Object newInstance(Class impl)
                   throws DiscoveryException,
                          InstantiationException,
                          IllegalAccessException,
                          NoSuchMethodException,
                          InvocationTargetException
Instantiate a new

Throws:
DiscoveryException
InstantiationException
IllegalAccessException
NoSuchMethodException
InvocationTargetException

verifyAncestory

public void verifyAncestory(Class impl)


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.