public class JRSingletonCache<T> extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EXCEPTION_MESSAGE_KEY_CLASS_NOT_COMPATIBLE |
static String |
EXCEPTION_MESSAGE_KEY_CLASS_NOT_FOUND |
static String |
EXCEPTION_MESSAGE_KEY_INSTANCE_ERROR |
Constructor and Description |
---|
JRSingletonCache(Class<T> itf)
Creates a cache of singleton instances.
|
Modifier and Type | Method and Description |
---|---|
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() |
public static final String EXCEPTION_MESSAGE_KEY_CLASS_NOT_COMPATIBLE
public static final String EXCEPTION_MESSAGE_KEY_CLASS_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_INSTANCE_ERROR
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
JRException
protected Object getContextKey()
Copyright © 2021 TIBCO Software Inc.. All rights reserved.