T - public abstract class SingletonProvider<T>
extends java.lang.Object
implements javax.inject.Provider<T>
Providers that which to enforce singleton semantics
for a type.
Note that this class is needed since annotating a Provider with @Singleton
makes the Provider a singleton and NOT the type is it providing. So the
same Provider is returned when the Provider is injector the a new call to
get() is made whenever the type T is injected.| Constructor and Description |
|---|
SingletonProvider() |
public final T get()
create method
when creating the object for the first time.get in interface javax.inject.Provider<T>protected abstract T create()