org.glassfish.hk2
Interface ManagedComponentProvider<T>

All Superinterfaces:
Provider<T>

public interface ManagedComponentProvider<T>
extends Provider<T>

A ManagedComponentProvider is one in which its backing component that it provides can either be in an active or inactive state.

Lazy implies managed. However, managed does NOT imply lazy. Therefore, a ManagedComponentProvider might allow for release() but it is not "lazy" meaning that it is active in its natural state.

ManagedComponentProviders are usually lazy, Singleton scoped services (but not always). Lazy, Singleton services exhibit the following characteristics:

  • (a) are initially not active,
  • (b) are made active by calling Provider.get(),
  • (c) once active will produce the same service each time (i.e., assert(get() == get())},
  • (d) once released, a call to get() will return a newly created instance.

    Author:
    Jerome Dochez, Jeff Trent

    Method Summary
     boolean isActive()
               
     void release()
              Release the component/service if active.
     
    Methods inherited from interface org.glassfish.hk2.Provider
    get, getAnnotations, getDescriptor, type
     

    Method Detail

    isActive

    boolean isActive()
    Returns:
    true if the component/service is currently active

    release

    void release()
    Release the component/service if active.



    Copyright © 2011 Oracle Corporation. All Rights Reserved.