|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Registrar
Defines the available methods for registering components (including controllers). By default Constructor based dependency injection is utilized.
Nested Class Summary | |
---|---|
static class |
Registrar.Injection
|
Method Summary | |
---|---|
void |
application()
Components registered in this method will be availables for the life of the Application. |
java.lang.Object |
getRegistered(java.lang.Object typeOrInstance)
Returns a registered component |
boolean |
isRegistered(java.lang.Object typeOrInstance)
Determines if a component is already registered |
Registrar |
register(java.lang.Class<?> type,
java.lang.Object... parameters)
Registers a component in the current context. |
Registrar |
register(java.lang.Object key,
java.lang.Class<?> type,
java.lang.Object... parameters)
Registers a component in the current context under the given key. |
Registrar |
registerInstance(java.lang.Object instance)
Registers a component instance directly in the current context. |
Registrar |
registerInstance(java.lang.Object key,
java.lang.Object instance)
Registers a component instance directly in the current context under the given key. |
Registrar |
registerNonCaching(java.lang.Class<?> type,
java.lang.Object... parameters)
Registers a component in non-caching mode, ie with new instance created for each class with a defined dependency |
Registrar |
registerNonCaching(java.lang.Object key,
java.lang.Class<?> type,
java.lang.Object... parameters)
Registers a component under the given key in non-caching mode, ie with new instance created for each class with a defined dependency |
void |
request()
Components registered in this method will be availables for the life of a request. |
void |
session()
Components registered in this method will be availables for the life of a Users session. |
Registrar |
useInjection(Registrar.Injection injection)
Use the given injection type for component instantiation. |
Method Detail |
---|
Registrar useInjection(Registrar.Injection injection)
Registrar.Injection.CONSTRUCTOR
.
injection
- the Injection to use
boolean isRegistered(java.lang.Object typeOrInstance)
typeOrInstance
- the component Class type or Object instance/key
true
if component is registeredjava.lang.Object getRegistered(java.lang.Object typeOrInstance)
typeOrInstance
- the component Class type or Object instance/key
RegistrarException
- if component not registered or more than one instance foundRegistrar register(java.lang.Class<?> type, java.lang.Object... parameters)
type
- represents both the key and type the object will be registered underparameters
- any parameters needed to satisfy the component being registered
Registrar register(java.lang.Object key, java.lang.Class<?> type, java.lang.Object... parameters)
key
- represents the key the object will be registered undertype
- represents the component typeparameters
- any parameters needed to satisfy the component being registered
Registrar registerInstance(java.lang.Object instance)
instance
- to be registered
Registrar registerInstance(java.lang.Object key, java.lang.Object instance)
key
- the key the instance is to be registered underinstance
- to be registered
Registrar registerNonCaching(java.lang.Class<?> type, java.lang.Object... parameters)
type
- represents both the key and type the object will be registered underparameters
- any parameters needed to satisfy the component being registered
Registrar registerNonCaching(java.lang.Object key, java.lang.Class<?> type, java.lang.Object... parameters)
key
- represents the key the object will be registered undertype
- represents the component typeparameters
- any parameters needed to satisfy the component being registered
void application()
ContextLevel.APPLICATION
,
ServletContextListener
void session()
ContextLevel.SESSION
,
HttpSessionListener
void request()
ContextLevel.REQUEST
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |