Package org.glassfish.hk2.api
Annotation Type Immediate
-
@Documented @Retention(RUNTIME) @Scope @Target({TYPE,METHOD}) public @interface ImmediateImmediate is a scope that operates likeSingletonscope, except that instances are created as soon as their correspondingDescriptors are added. When the correspondingDescriptoris removed from the locator the Immediate scope service is destroyed. In particular Immediate scope services are not destroyed if theServiceHandle.destroy()method is called. Care should be taken with the services injected into an immediate service, as they also become virtual immediate servicesThe Immediate scope is not automatically handled by a new ServiceLocator. In order to enable the Immediate scope the user can either add an implementation of
Contextwhich handles it or it can use theServiceLocatorUtilities.enableImmediateScope(ServiceLocator)method.