|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.schwarzrot.app.support.ApplicationServiceProvider
public final class ApplicationServiceProvider
central singleton for access configurable services. A service may be configured via XML-context or created dynamically by the application. Each service is registered to a class or interface and all request refer to that class or interface.
This class is one of the fundaments of IOC-pattern (inversion of control), which includes, that there exists no static factories, but instances of factories published as service, so that they may be exchanged without compilation or even at runtime.
i.e. a MessageSource
is a service to find localized messages by a
key. No matter what class offers this service, the service is registered to
org.springframework.context.MessageSource
Constructor Summary | |
---|---|
ApplicationServiceProvider()
|
Method Summary | ||
---|---|---|
static Map<Class<?>,Object> |
getPool()
|
|
static
|
getService(Class<S> clazz)
retrieve a registered service |
|
static boolean |
hasService(Class<?> clazz)
query wether a service has been registered for given class or interface |
|
static
|
registerService(Class<S> clazz,
S service)
register a service to be known by the class or interface |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationServiceProvider()
Method Detail |
---|
public static Map<Class<?>,Object> getPool()
public static <S> S getService(Class<S> clazz)
clazz
- - the class or interface to identify the service
public static boolean hasService(Class<?> clazz)
clazz
- - the class or interface to identify the service
public static <S> void registerService(Class<S> clazz, S service)
S
- - type of the service to registerclazz
- - the class or interface to identify the serviceservice
- - the service to register
|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |