Annotation Type Immediate


@Documented @Retention(RUNTIME) @Scope @Target({TYPE,METHOD}) public @interface Immediate
Immediate is a scope that operates like Singleton scope, except that instances are created as soon as their corresponding Descriptors are added. When the corresponding Descriptor is removed from the locator the Immediate scope service is destroyed. In particular Immediate scope services are not destroyed if the ServiceHandle.destroy() method is called. Care should be taken with the services injected into an immediate service, as they also become virtual immediate services

The 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 Context which handles it or it can use the ServiceLocatorUtilities.enableImmediateScope(ServiceLocator) method.