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 of Singletons
Author:
Sanjeeb.Sahoo@Sun.COM, Pete Muir
See Also:
  • Constructor Details

    • SingletonProvider

      protected SingletonProvider()
      Protected constructor. instance() should be used to obtain an instance of this class.
  • Method Details

    • instance

      public static SingletonProvider instance()
      Returns a singleton instance of this class.
      Returns:
      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()
      Sets the reference to the singleton instance of this class back to null.