Class ImmediateContext
java.lang.Object
org.glassfish.hk2.utilities.ImmediateContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashMap<ActiveDescriptor<?>, Long> private final HashMap<ActiveDescriptor<?>, HandleAndService> private final ServiceLocatorprivate final Filter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(ActiveDescriptor<?> descriptor) Determines if this context has a value for the given keyvoiddestroyOne(ActiveDescriptor<?> descriptor) This method is called whenServiceHandle.destroy()method is called.private voiddestroyOne(ActiveDescriptor<?> descriptor, List<ImmediateErrorHandler> errorHandlers) Destroys a single descriptorvoiddoWork()<U> UfindOrCreate(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 List<ActiveDescriptor<?>> Class<? extends Annotation> getScope()The scope for which this is the contextbooleanisActive()True if this context is active, false otherwisevoidshutdown()For when the server shuts downbooleanReturns true if the findOrCreate method can return null
-
Field Details
-
currentImmediateServices
-
creating
-
locator
-
validationFilter
-
-
Constructor Details
-
ImmediateContext
-
-
Method Details
-
getScope
-
findOrCreate
Description copied from interface:ContextCreates a contextual instance of this ActiveDescriptor by calling its create method if there is no other matching contextual instance. If there is already a contextual instance it is returned. If parent is null then this must work like the find call- Specified by:
findOrCreatein interfaceContext<Immediate>- Parameters:
activeDescriptor- The descriptor to createroot- The root handle- Returns:
- The service
-
containsKey
Description copied from interface:ContextDetermines if this context has a value for the given key- Specified by:
containsKeyin interfaceContext<Immediate>- Parameters:
descriptor- The descriptor to find- Returns:
- true if this service has been created
-
destroyOne
Description copied from interface:ContextThis method is called whenServiceHandle.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- Specified by:
destroyOnein interfaceContext<Immediate>- Parameters:
descriptor- A non-null descriptor upon whichServiceHandle.destroy()has been called
-
destroyOne
Destroys a single descriptor- Parameters:
descriptor- The descriptor to destroyerrorHandlers- The handlers for exceptions (if null will get from service locator)
-
supportsNullCreation
public boolean supportsNullCreation()Description copied from interface:ContextReturns true if the findOrCreate method can return null- Specified by:
supportsNullCreationin interfaceContext<Immediate>- Returns:
- true if null is a legal value from the findOrCreate method
-
isActive
-
shutdown
-
getImmediateServices
-
getValidationFilter
-
doWork
public void doWork()
-