|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.util.JRSingletonCache<T>
public class JRSingletonCache<T>
Utility to use as a soft cache of singleton instances.
Constructor Summary | |
---|---|
JRSingletonCache(java.lang.Class<T> itf)
Creates a cache of singleton instances. |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JRSingletonCache(java.lang.Class<T> itf)
itf
- a interface or class that should be implemented by all classes cached by this objectMethod Detail |
---|
public 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |