T
- The type of the object Factory to locate.public class FactoryFinder<T> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
FactoryFinder.ObjectFactory
The strategy that the FactoryFinder uses to find load and instantiate Objects can be
changed out by calling the
setObjectFactory(org.apache.qpid.jms.util.FactoryFinder.ObjectFactory)
method with a custom implementation of ObjectFactory. |
protected static class |
FactoryFinder.StandaloneObjectFactory
The default implementation of Object factory which works well in stand-alone applications.
|
Constructor and Description |
---|
FactoryFinder(Class<T> factoryType,
String path)
Creates a new instance of the FactoryFinder using the given search path.
|
Modifier and Type | Method and Description |
---|---|
static FactoryFinder.ObjectFactory |
getObjectFactory() |
T |
newInstance(String key)
Creates a new instance of the given key.
|
void |
registerProviderFactory(String scheme,
T factory)
Allow registration of a Provider factory without wiring via META-INF classes
|
static void |
setObjectFactory(FactoryFinder.ObjectFactory objectFactory)
Sets the ObjectFactory instance to use when searching for the Factory class.
|
public static FactoryFinder.ObjectFactory getObjectFactory()
public static void setObjectFactory(FactoryFinder.ObjectFactory objectFactory)
objectFactory
- the new object factory to use when searching for a Factory instance.public T newInstance(String key) throws IllegalAccessException, InstantiationException, IOException, ClassNotFoundException, ClassCastException, ResourceNotFoundException
key
- is the key to add to the path to find a text file containing the factory nameIllegalAccessException
- if an error occurs while accessing the search path.InstantiationException
- if the factory object fails on create.ResourceNotFoundException
- if the resource with the given key does not exist.IOException
- if the search encounter an IO error.ClassNotFoundException
- if the class that is to be loaded cannot be found.ClassCastException
- if the found object is not assignable to the request factory type.Copyright © 2013–2016 The Apache Software Foundation. All rights reserved.