public class JRSingletonCache<T>
extends java.lang.Object
Constructor and Description |
---|
JRSingletonCache(java.lang.Class<T> itf)
Creates a cache of singleton instances.
|
Modifier and Type | Method and Description |
---|---|
protected T |
createInstance(java.lang.String className) |
T |
getCachedInstance(java.lang.String className)
Returns the singleton instance corresponding to a class.
|
protected java.util.Map<java.lang.String,T> |
getContextInstanceCache() |
protected java.lang.Object |
getContextKey() |
public JRSingletonCache(java.lang.Class<T> itf)
itf
- a interface or class that should be implemented by all classes cached by this objectpublic T getCachedInstance(java.lang.String className) throws JRException
The instance is first searched into the cache and created if not found.
The class is expected to have a no-argument constructor.
className
- JRException
protected T createInstance(java.lang.String className) throws JRException
JRException
protected java.util.Map<java.lang.String,T> getContextInstanceCache()
protected java.lang.Object getContextKey()
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com