net.sf.jasperreports.engine.util
public class JRSingletonCache extends java.lang.Object
| Constructor and Description |
|---|
JRSingletonCache(java.lang.Class itf)
Creates a cache of singleton instances.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
createInstance(java.lang.String className) |
java.lang.Object |
getCachedInstance(java.lang.String className)
Returns the singleton instance corresponding to a class.
|
protected java.util.Map |
getContextInstanceCache() |
protected java.lang.Object |
getContextKey() |
public JRSingletonCache(java.lang.Class itf)
itf - a interface or class that should be implemented by all classes cached by this objectpublic java.lang.Object 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 - JRExceptionprotected java.lang.Object createInstance(java.lang.String className)
throws JRException
JRExceptionprotected java.util.Map getContextInstanceCache()
protected java.lang.Object getContextKey()
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com