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:
SingletonProvider

Method Summary
 void clear()
          Clear the singleton
 T get()
          Access the singleton
 boolean isSet()
          Check if the singleton is set
 void set(T object)
          Store a singleton
 

Method Detail

get

T get()
Access the singleton

Returns:
a singleton object
Throws:
IllegalStateException - if the singleton is not set

isSet

boolean isSet()
Check if the singleton is set

Returns:
true if the singleton is set

set

void set(T object)
Store a singleton

Parameters:
object - the object to store

clear

void clear()
Clear the singleton



Copyright © 2013 Seam Framework. All Rights Reserved.