org.jboss.webbeans.bootstrap.api
Class SingletonProvider

java.lang.Object
  extended by org.jboss.webbeans.bootstrap.api.SingletonProvider
Direct Known Subclasses:
IsolatedStaticSingletonProvider, TCCLSingletonProvider

public abstract class SingletonProvider
extends java.lang.Object

A provider of Singletons

Author:
Sanjeeb.Sahoo@Sun.COM, Pete Muir
See Also:
IsolatedStaticSingletonProvider, TCCLSingletonProvider

Constructor Summary
protected SingletonProvider()
           
 
Method Summary
abstract
<T> Singleton<T>
create(java.lang.Class<? extends T> expectedType)
          Create a new singleton
static void initialize(SingletonProvider instance)
          Initialize with an explicit instance
static SingletonProvider instance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonProvider

protected SingletonProvider()
Method Detail

instance

public static SingletonProvider instance()

create

public abstract <T> Singleton<T> create(java.lang.Class<? extends T> expectedType)
Create a new 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 -


Copyright © 2011. All Rights Reserved.