Package org.jboss.weld.bootstrap.api
Interface Singleton<T>
-
public interface Singleton<T>
Holds a reference to an application singleton. This singleton is used internally by Weld to store various application scoped objects. This allows Weld to operate as a shared library. In a shared mode, the same instance of Weld implementation is used by all the applications in a server environment. In the exclusive mode, each application loads a separate copy of Weld implementation at the application level. Alternative implementations of Singleton can be used as required- Author:
- [email protected], Pete Muir
- See Also:
SingletonProvider
-
-
Method Detail
-
get
T get(String id)
Access the singleton- Parameters:
id
- singleton identifier- Returns:
- a singleton object
- Throws:
IllegalStateException
- if the singleton is not set
-
isSet
boolean isSet(String id)
Check if the singleton is set- Parameters:
id
- singleton identifier- Returns:
- true if the singleton is set
-
set
void set(String id, T object)
Store a singleton- Parameters:
id
- singleton identifierobject
- the object to store
-
clear
void clear(String id)
Clear the singleton- Parameters:
id
- singleton identifier
-
-