@Singleton @Visibility(value=LOCAL) public class InheritableThreadContext extends Object implements Context<InheritableThread>
| Constructor and Description |
|---|
InheritableThreadContext() |
| 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. |
<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
|
boolean |
isActive()
True if this context is active, false otherwise
|
void |
shutdown()
Shut down this context.
|
boolean |
supportsNullCreation()
Returns true if the findOrCreate method can return null
|
public Class<? extends Annotation> getScope()
ContextgetScope in interface Context<InheritableThread>public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root)
ContextfindOrCreate in interface Context<InheritableThread>activeDescriptor - The descriptor to use when creating instancesroot - The extended provider for the outermost parent being createdpublic boolean containsKey(ActiveDescriptor<?> descriptor)
ContextcontainsKey in interface Context<InheritableThread>descriptor - The descriptor to look for in this contextpublic boolean isActive()
ContextisActive in interface Context<InheritableThread>public boolean supportsNullCreation()
ContextsupportsNullCreation in interface Context<InheritableThread>public void shutdown()
Contextshutdown in interface Context<InheritableThread>public 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<InheritableThread>descriptor - A non-null descriptor upon which ServiceHandle.destroy()
has been calledCopyright © 2009–2019 Oracle Corporation. All rights reserved.