Package net.sf.jasperreports.engine.fill
Class JRClonePool
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.JRClonePool
-
public class JRClonePool extends Object
Working clones pooling utility used at fill time.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND
-
Constructor Summary
Constructors Constructor Description JRClonePool(JRFillCloneable original, boolean trackLockedClones, boolean useOriginal)
Creates a clone pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getClone()
Retrieves a clone from the pool.void
releaseClone(Object clone)
Release the clone back to the pool.
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JRClonePool
public JRClonePool(JRFillCloneable original, boolean trackLockedClones, boolean useOriginal)
Creates a clone pool.- Parameters:
original
- the original element that will be clonedtrackLockedClones
- whether to track clones retrieved from the poolIf set, the pool will keep a set of in-use clones and the caller will always have to release the clones back to the pool.
useOriginal
- whether the original object can be used as a working clone
-
-
Method Detail
-
getClone
public Object getClone()
Retrieves a clone from the pool.The clone is reserved to the caller who will need to call
releaseClone(Object)
to release it back to the pool.- Returns:
- a clone of the original object
-
releaseClone
public void releaseClone(Object clone)
Release the clone back to the pool. The clone will be available for other clients.- Parameters:
clone
- the clone to be released
-
-