org.apache.camel.spi
Interface FactoryFinder

All Known Implementing Classes:
DefaultFactoryFinder

public interface FactoryFinder

Finder to find factories from the resource classpath, usually META-INF/services/org/apache/camel/.

Version:
$Revision: 754461 $

Method Summary
 Class findClass(String key)
          Finds the given factory class using the the key to lookup.
 Class findClass(String key, String propertyPrefix)
          Finds the given factory class using the the key to lookup.
 String getResourcePath()
          Gets the resource classpath.
 Object newInstance(String key)
          Creates a new class instance using the key to lookup
<T> List<T>
newInstances(String key, Injector injector, Class<T> type)
          Creates a new class instance using the key to lookup
 

Method Detail

getResourcePath

String getResourcePath()
Gets the resource classpath.

Returns:
the resource classpath.

newInstance

Object newInstance(String key)
                   throws NoFactoryAvailableException
Creates a new class instance using the key to lookup

Parameters:
key - is the key to add to the path to find a text file containing the factory name
Returns:
a newly created instance
Throws:
NoFactoryAvailableException - is thrown if no factories exist for the given key

newInstances

<T> List<T> newInstances(String key,
                         Injector injector,
                         Class<T> type)
                     throws ClassNotFoundException,
                            IOException
Creates a new class instance using the key to lookup

Parameters:
key - is the key to add to the path to find a text file containing the factory name
injector - injector to use
type - expected type
Returns:
a newly created instance as the expected type
Throws:
ClassNotFoundException - is thrown if not found
IOException - is thrown if loading the class or META-INF file not found

findClass

Class findClass(String key)
                throws ClassNotFoundException,
                       IOException
Finds the given factory class using the the key to lookup.

Parameters:
key - is the key to add to the path to find a text file containing the factory name
Returns:
the factory class
Throws:
ClassNotFoundException - is thrown if class not found
IOException - is thrown if loading the class or META-INF file not found

findClass

Class findClass(String key,
                String propertyPrefix)
                throws ClassNotFoundException,
                       IOException
Finds the given factory class using the the key to lookup.

Parameters:
key - is the key to add to the path to find a text file containing the factory name
propertyPrefix - prefix on key
Returns:
the factory class
Throws:
ClassNotFoundException - is thrown if not found
IOException - is thrown if loading the class or META-INF file not found


Apache CAMEL