| Modifier and Type | Field and Description |
|---|---|
private java.util.HashMap<ActiveDescriptor<?>,java.lang.Long> |
creating |
private java.util.HashMap<ActiveDescriptor<?>,HandleAndService> |
currentImmediateServices |
private ServiceLocator |
locator |
private Filter |
validationFilter |
| Modifier | Constructor and Description |
|---|---|
private |
ImmediateContext(ServiceLocator locator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(ActiveDescriptor<?> descriptor)
Determines if this context has a value for the given key
|
void |
destroyOne(ActiveDescriptor<?> descriptor)
This method is called when
ServiceHandle.destroy() method is called. |
private void |
destroyOne(ActiveDescriptor<?> descriptor,
java.util.List<ImmediateErrorHandler> errorHandlers)
Destroys a single descriptor
|
void |
doWork() |
<U> U |
findOrCreate(ActiveDescriptor<U> activeDescriptor,
ServiceHandle<?> root)
Creates a contextual instance of this ActiveDescriptor by calling its
create method if there is no other matching contextual instance.
|
private java.util.List<ActiveDescriptor<?>> |
getImmediateServices() |
java.lang.Class<? extends java.lang.annotation.Annotation> |
getScope()
The scope for which this is the context
|
Filter |
getValidationFilter() |
boolean |
isActive()
True if this context is active, false otherwise
|
void |
shutdown()
For when the server shuts down
|
boolean |
supportsNullCreation()
Returns true if the findOrCreate method can return null
|
private final java.util.HashMap<ActiveDescriptor<?>,HandleAndService> currentImmediateServices
private final java.util.HashMap<ActiveDescriptor<?>,java.lang.Long> creating
private final ServiceLocator locator
private final Filter validationFilter
@Inject private ImmediateContext(ServiceLocator locator)
public java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
Contextpublic <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root)
ContextfindOrCreate in interface Context<Immediate>activeDescriptor - The descriptor to createroot - The root handlepublic boolean containsKey(ActiveDescriptor<?> descriptor)
ContextcontainsKey in interface Context<Immediate>descriptor - The descriptor to findpublic void destroyOne(ActiveDescriptor<?> descriptor)
ContextServiceHandle.destroy() method is called.
It is up to the context implementation whether or not to honor this destruction
request based on the lifecycle requirements of the contextdestroyOne in interface Context<Immediate>descriptor - A non-null descriptor upon which ServiceHandle.destroy()
has been calledprivate void destroyOne(ActiveDescriptor<?> descriptor, java.util.List<ImmediateErrorHandler> errorHandlers)
descriptor - The descriptor to destroyerrorHandlers - The handlers for exceptions (if null will get from service locator)public boolean supportsNullCreation()
ContextsupportsNullCreation in interface Context<Immediate>public boolean isActive()
Contextpublic void shutdown()
private java.util.List<ActiveDescriptor<?>> getImmediateServices()
public Filter getValidationFilter()
public void doWork()