Package org.jboss.weld.bootstrap.api
Class SingletonProvider
- java.lang.Object
-
- org.jboss.weld.bootstrap.api.SingletonProvider
-
- Direct Known Subclasses:
IsolatedStaticSingletonProvider
,RegistrySingletonProvider
,TCCLSingletonProvider
public abstract class SingletonProvider extends Object
A provider ofSingleton
s- Author:
- [email protected], Pete Muir
- See Also:
IsolatedStaticSingletonProvider
,TCCLSingletonProvider
,RegistrySingletonProvider
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SingletonProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <T> Singleton<T>
create(Class<? extends T> expectedType)
Create a new singletonstatic void
initialize(SingletonProvider instance)
Initialize with an explicit instancestatic SingletonProvider
instance()
static void
reset()
-
-
-
Method Detail
-
instance
public static SingletonProvider instance()
-
create
public abstract <T> Singleton<T> create(Class<? extends T> expectedType)
Create a new singleton- Type Parameters:
T
- type of Java object stored in the singleton- Parameters:
expectedType
- represents the type of Java object stored in the singleton- Returns:
- a singelton
-
initialize
public static void initialize(SingletonProvider instance)
Initialize with an explicit instance- Parameters:
instance
- the explicit instance
-
reset
public static void reset()
-
-