org.apache.camel.util
Class FactoryFinder
java.lang.Object
org.apache.camel.util.FactoryFinder
public class FactoryFinder
- extends Object
Finder to find factories from the resource classpath, usually META-INF/services/org/apache/camel/.
Method Summary |
Class |
findClass(String key)
|
Class |
findClass(String key,
String propertyPrefix)
|
List<Class> |
findClasses(String key)
|
List<Class> |
findClasses(String key,
String propertyPrefix)
|
String |
getPath()
|
Object |
newInstance(String key)
Creates a new instance of the given key |
Object |
newInstance(String key,
Injector injector)
|
|
newInstance(String key,
Injector injector,
Class<T> expectedType)
|
Object |
newInstance(String key,
Injector injector,
String propertyPrefix)
|
|
newInstance(String key,
Injector injector,
String propertyPrefix,
Class<T> expectedType)
|
Object |
newInstance(String key,
String propertyPrefix)
|
|
newInstances(String key,
Injector injector,
Class<T> type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
classMap
protected final ConcurrentHashMap<String,Class> classMap
FactoryFinder
public FactoryFinder()
FactoryFinder
public FactoryFinder(String path)
newInstance
public Object newInstance(String key)
throws IllegalAccessException,
InstantiationException,
IOException,
ClassNotFoundException
- Creates a new instance of the given key
- 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:
IllegalAccessException
InstantiationException
IOException
ClassNotFoundException
newInstance
public Object newInstance(String key,
String propertyPrefix)
throws IllegalAccessException,
InstantiationException,
IOException,
ClassNotFoundException
- Throws:
IllegalAccessException
InstantiationException
IOException
ClassNotFoundException
newInstance
public Object newInstance(String key,
Injector injector)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
newInstance
public Object newInstance(String key,
Injector injector,
String propertyPrefix)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
newInstance
public <T> T newInstance(String key,
Injector injector,
Class<T> expectedType)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
newInstance
public <T> T newInstance(String key,
Injector injector,
String propertyPrefix,
Class<T> expectedType)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
newInstances
public <T> List<T> newInstances(String key,
Injector injector,
Class<T> type)
throws IOException,
ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
findClass
public Class findClass(String key)
throws ClassNotFoundException,
IOException
- Throws:
ClassNotFoundException
IOException
findClass
public Class findClass(String key,
String propertyPrefix)
throws ClassNotFoundException,
IOException
- Throws:
ClassNotFoundException
IOException
findClasses
public List<Class> findClasses(String key)
throws ClassNotFoundException,
IOException
- Throws:
ClassNotFoundException
IOException
findClasses
public List<Class> findClasses(String key,
String propertyPrefix)
throws ClassNotFoundException,
IOException
- Throws:
ClassNotFoundException
IOException
getPath
public String getPath()
Copyright © 2009 IONA Open Source Community. All Rights Reserved.