|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.hk2.internal.PerThreadContext
@Singleton public class PerThreadContext
| Constructor Summary | |
|---|---|
PerThreadContext()
|
|
| Method Summary | ||
|---|---|---|
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. |
|
|
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 |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PerThreadContext()
| Method Detail |
|---|
public Class<? extends Annotation> getScope()
Context
getScope in interface Context<PerThread>
public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor,
ServiceHandle<?> root)
Context
findOrCreate in interface Context<PerThread>activeDescriptor - The descriptor to use when creating instancesroot - The extended provider for the outermost parent being created
public boolean containsKey(ActiveDescriptor<?> descriptor)
Context
containsKey in interface Context<PerThread>descriptor - The descriptor to look for in this context
public boolean isActive()
Context
isActive in interface Context<PerThread>public boolean supportsNullCreation()
Context
supportsNullCreation in interface Context<PerThread>public void shutdown()
Context
shutdown in interface Context<PerThread>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 context
destroyOne in interface Context<PerThread>descriptor - A non-null descriptor upon which ServiceHandle.destroy()
has been called
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||