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:
- Sanjeeb.Sahoo@Sun.COM, Pete Muir
- See Also:
-
Method Summary
-
Method Details
-
get
Access the singleton- Parameters:
id- singleton identifier- Returns:
- a singleton object
- Throws:
IllegalStateException- if the singleton is not set
-
isSet
Check if the singleton is set- Parameters:
id- singleton identifier- Returns:
- true if the singleton is set
-
set
Store a singleton- Parameters:
id- singleton identifierobject- the object to store
-
clear
Clear the singleton- Parameters:
id- singleton identifier
-