|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jasperreports.engine.util.JRSingletonCache<T>
public class JRSingletonCache<T>
Utility to use as a soft cache of singleton instances.
| Constructor Summary | |
|---|---|
JRSingletonCache(Class<T> itf)
Creates a cache of singleton instances. |
|
| Method Summary | |
|---|---|
protected T |
createInstance(String className)
|
T |
getCachedInstance(String className)
Returns the singleton instance corresponding to a class. |
protected Map<String,T> |
getContextInstanceCache()
|
protected Object |
getContextKey()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JRSingletonCache(Class<T> itf)
itf - a interface or class that should be implemented by all classes cached by this object| Method Detail |
|---|
public T getCachedInstance(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(String className)
throws JRException
JRExceptionprotected Map<String,T> getContextInstanceCache()
protected Object getContextKey()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||