Package org.apache.activemq.util
Class FactoryFinder.StandaloneObjectFactory
- java.lang.Object
-
- org.apache.activemq.util.FactoryFinder.StandaloneObjectFactory
-
- All Implemented Interfaces:
FactoryFinder.ObjectFactory
- Enclosing class:
- FactoryFinder<T>
protected static class FactoryFinder.StandaloneObjectFactory extends Object implements FactoryFinder.ObjectFactory
The default implementation of Object factory which works well in standalone applications.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStandaloneObjectFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectcreate(String path)<T> Tcreate(String path, Class<T> requiredType, Set<Class<? extends T>> allowedImpls)This method loads objects by searching for classes in the given path.static PropertiesloadProperties(String uri)
-
-
-
Method Detail
-
create
public Object create(String path) throws IllegalAccessException, InstantiationException, IOException, ClassNotFoundException
- Specified by:
createin interfaceFactoryFinder.ObjectFactory- Parameters:
path- the full service path- Returns:
- Throws:
IllegalAccessExceptionInstantiationExceptionIOExceptionClassNotFoundException
-
create
public <T> T create(String path, Class<T> requiredType, Set<Class<? extends T>> allowedImpls) throws InstantiationException, IllegalAccessException, ClassNotFoundException, IOException
Description copied from interface:FactoryFinder.ObjectFactoryThis method loads objects by searching for classes in the given path. A requiredType and Set of allowed implementations are provided for implementations to use for validation. Note is up to the actual implementations that implementFactoryFinder.ObjectFactoryto decide how to use both parameters. By default, the method just delegates toFactoryFinder.ObjectFactory.create(String)- Specified by:
createin interfaceFactoryFinder.ObjectFactory- Parameters:
path- the full service pathrequiredType- the requiredType any objects must implementallowedImpls- The set of allowed impls- Returns:
- Throws:
InstantiationExceptionIllegalAccessExceptionClassNotFoundExceptionIOException
-
loadProperties
public static Properties loadProperties(String uri) throws IOException
- Throws:
IOException
-
-