|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.core.services.AbstractServiceFactory<T>
T
- the type of the service to instantiate.
public abstract class AbstractServiceFactory<T>
A factory to create instances of a given type using the Java Service API.
Constructor Summary | |
---|---|
protected |
AbstractServiceFactory(InstanceCreator<T> creator) Default constructor. |
Method Summary | |
---|---|
T |
create() Creates an instance of a service in META-INF/services . |
T |
create(Class<? extends T> defaultType) Creates an instance of a service in META-INF/services . |
T |
createBackup(Class<? extends T> defaultType) Creates an instance with the backup strategy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractServiceFactory(InstanceCreator<T> creator) throws NullPointerException
creator
- the creator of instances created as defaults by this factory.
NullPointerException
- if
creator
is
null
.
Method Detail |
---|
public final T create() throws ConfigException
META-INF/services
.
ConfigException
- if a type cannot be instantiated.
public final T create(Class<? extends T> defaultType) throws ConfigException
META-INF/services
.
defaultType
- the default type to use if there is no configuration file found in
META-INF/services
or the configuration stored in JNDI.
ConfigException
- if a type cannot be instantiated.
public final T createBackup(Class<? extends T> defaultType)
defaultType
- the default type to use if there is no configuration file found in
META-INF/services
or the configuration stored in JNDI.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |