public abstract class AbstractContext<T> extends java.lang.Object implements Context, IdBoundContext<T>
Modifier and Type | Class and Description |
---|---|
private class |
AbstractContext.StoreHolder<X> |
Modifier and Type | Field and Description |
---|---|
private java.lang.ThreadLocal<java.util.Stack<AbstractContext.StoreHolder<T>>> |
activeStore |
private static java.util.logging.Logger |
log |
private java.util.concurrent.ConcurrentHashMap<T,ObjectStore> |
stores |
Constructor and Description |
---|
AbstractContext() |
Modifier and Type | Method and Description |
---|---|
void |
activate(T id) |
void |
clearAll() |
protected abstract ObjectStore |
createNewObjectStore() |
private ObjectStore |
createObjectStore(T id) |
void |
deactivate() |
void |
deactivateAll() |
void |
destroy(T id) |
T |
getActiveId() |
ObjectStore |
getObjectStore() |
boolean |
isActive() |
private static java.util.logging.Logger log
private java.util.concurrent.ConcurrentHashMap<T,ObjectStore> stores
private java.lang.ThreadLocal<java.util.Stack<AbstractContext.StoreHolder<T>>> activeStore
public T getActiveId()
getActiveId
in interface IdBoundContext<T>
public void activate(T id)
activate
in interface IdBoundContext<T>
public void deactivate()
deactivate
in interface IdBoundContext<T>
public void deactivateAll()
public void destroy(T id)
destroy
in interface IdBoundContext<T>
public ObjectStore getObjectStore()
getObjectStore
in interface Context
protected abstract ObjectStore createNewObjectStore()
private ObjectStore createObjectStore(T id)