|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.resource.util.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(Class<T> type) 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 . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractServiceFactory(Class<T> type)
type
- the type of instances created by this factory.
Method Detail |
---|
public final T create() throws ResourceException
META-INF/services
.
ResourceException
- if a type cannot be instantiated.
public final T create(Class<? extends T> defaultType) throws ResourceException
META-INF/services
.
defaultType
- the default type to use if there is no configuration file found in
META-INF/services
.
ResourceException
- if a type cannot be instantiated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |