org.mule.util
Class SpiUtils

java.lang.Object
  extended by org.mule.util.SpiUtils

public final class SpiUtils
extends Object


Field Summary
static String SERVICE_ROOT
           
 
Method Summary
static Class findService(Class spi, Class currentClass)
          Find class implementing a specified SPI.
static Class findService(Class spi, Properties props, Class currentClass)
          Find class implementing a specified SPI.
static Class findService(Class spi, String defaultImpl, Class currentClass)
          Find class implementing a specified SPI.
static Class findService(Class spi, String propertyFileName, String defaultImpl, Class currentClass)
          Find class implementing a specified SPI.
static InputStream findServiceDescriptor(String path, String name, Class currentClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_ROOT

public static final String SERVICE_ROOT
See Also:
Constant Field Values
Method Detail

findService

public static Class findService(Class spi,
                                String propertyFileName,
                                String defaultImpl,
                                Class currentClass)
Find class implementing a specified SPI.

Parameters:
spi - Service Provider Interface Class.
propertyFileName - is a location of a property file that contains the SPI property value
defaultImpl - Default implementation class name.
currentClass - is used to include the classloader of the calling class in the search. All system classloaders will be checked as well.
Returns:
Class implementing the SPI or null if a service was not found

findService

public static Class findService(Class spi,
                                String defaultImpl,
                                Class currentClass)
Find class implementing a specified SPI. The system properties will be checked for an SPI property to use. this will be the fully qualified SPI class name.

Parameters:
spi - Service Provider Interface Class.
defaultImpl - Default implementation class name.
currentClass - is used to include the classloader of the calling class in the search. All system classloaders will be checked as well.
Returns:
Class implementing the SPI or the default implementation class if nothing has been found

findService

public static Class findService(Class spi,
                                Class currentClass)
Find class implementing a specified SPI. The system properties will be checked for an SPI property to use. this will be the fully qualified SPI class name.

Parameters:
spi - Service Provider Interface Class.
currentClass - is used to include the classloader of the calling class in the search. All system classloaders will be checked as well.
Returns:
Class implementing the SPI or null if a service was not found

findService

public static Class findService(Class spi,
                                Properties props,
                                Class currentClass)
Find class implementing a specified SPI.

Parameters:
spi - Service Provider Interface Class.
currentClass - is used to include the classloader of the calling class in the search.
props - The properties will be checked for an SPI property to use. this will be the fully qualified SPI class name. All system classloaders will be checked as well.
Returns:
Class implementing the SPI or null if a service was not found

findServiceDescriptor

public static InputStream findServiceDescriptor(String path,
                                                String name,
                                                Class currentClass)


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.