public class FactoryFinder 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 method with a custom implementation of ObjectFactory.
|
protected static class |
FactoryFinder.StandaloneObjectFactory
The default implementation of Object factory which works well in standalone applications.
|
Constructor and Description |
---|
FactoryFinder(String path) |
Modifier and Type | Method and Description |
---|---|
static FactoryFinder.ObjectFactory |
getObjectFactory() |
Object |
newInstance(String key)
Creates a new instance of the given key
|
static void |
setObjectFactory(FactoryFinder.ObjectFactory objectFactory) |
public FactoryFinder(String path)
public static FactoryFinder.ObjectFactory getObjectFactory()
public static void setObjectFactory(FactoryFinder.ObjectFactory objectFactory)
public Object newInstance(String key) throws IllegalAccessException, InstantiationException, IOException, ClassNotFoundException
key
- is the key to add to the path to find a text file containing
the factory nameIllegalAccessException
- On illegal accessInstantiationException
- On can not instantiate exceptionIOException
- On IOExceptionClassNotFoundException
- When class not on class pathCopyright © 2018 JBoss by Red Hat. All rights reserved.