Package org.apache.camel.spi
Interface FactoryFinder
-
public interface FactoryFinderFinder to find factories from the resource classpath, usually META-INF/services/org/apache/camel/.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_PATH
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<Class<?>>findClass(String key)Finds the given factory class using the key to lookup.Optional<Class<?>>findOptionalClass(String key)Finds the optional factory class using the key to lookup.StringgetResourcePath()Gets the resource classpath.Optional<Object>newInstance(String key)Creates a new class instance using the key to lookup<T> Optional<T>newInstance(String key, Class<T> type)Creates a new class instance using the key to lookup
-
-
-
Field Detail
-
DEFAULT_PATH
static final String DEFAULT_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getResourcePath
String getResourcePath()
Gets the resource classpath.- Returns:
- the resource classpath.
-
newInstance
Optional<Object> newInstance(String key)
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 (if exists)
-
newInstance
<T> Optional<T> newInstance(String key, Class<T> type)
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 nametype- the class type- Returns:
- a newly created instance (if exists)
-
findClass
Optional<Class<?>> findClass(String key)
Finds the given factory class 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:
- the factory class
-
-