@Documented @Retention(value=RUNTIME) @Scope @Target(value={TYPE,METHOD}) public @interface Immediate
Singleton
scope, except that instances are created as soon as their
corresponding Descriptor
s 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.
Copyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.