@Singleton @Visibility(value=LOCAL) public class ImmediateContext extends Object implements Context<Immediate>
| 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. |
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.
|
Class<? extends 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
|
public Class<? extends 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 calledpublic boolean supportsNullCreation()
ContextsupportsNullCreation in interface Context<Immediate>public boolean isActive()
Contextpublic void shutdown()
public Filter getValidationFilter()
public void doWork()
Copyright © 2009–2019 Oracle Corporation. All rights reserved.