Package io.milton.context
Class Context
java.lang.Object
io.milton.context.Context
- All Implemented Interfaces:
Contextual
- Direct Known Subclasses:
RequestContext,RootContext
Basic context functionality. Use either a RootContext or RequestContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HashMap<Class,Registration> protected HashMap<String,Registration> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T<T> Tprotected <T> Registration<T>getRegistration(Class<T> c) protected <T> Registration<T>int<T> Registration<T>Place o into context, keying by the given id<T> Registration<T>Put the given object into context, keying only the given id<T> Registration<T>put(T o) Place the given object into context, keying only by its class<T> Registration<T>put(T o, RemovalCallback f) voidtearDown()
-
Field Details
-
itemByClass
-
itemByName
-
-
Constructor Details
-
Context
protected Context()Used by subclasses
-
-
Method Details
-
numItemsById
public int numItemsById() -
get
- Specified by:
getin interfaceContextual
-
get
- Specified by:
getin interfaceContextual
-
getRegistration
-
getRegistration
-
put
Place o into context, keying by the given id- Type Parameters:
T-- Parameters:
id-o-- Returns:
-
put
Place the given object into context, keying only by its class -
put
-
put
Put the given object into context, keying only the given id -
tearDown
public void tearDown()
-