public class JRFileVirtualizer extends JRAbstractLRUVirtualizer
JRAbstractLRUVirtualizer.Cache, JRAbstractLRUVirtualizer.CacheReference
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_TEMP_FILES_SET_DELETE_ON_EXIT
Property used to decide whether
deleteOnExit should be requested
for temporary files created by the virtualizer. |
lastObjectMap, lastObjectRef, lastObjectSet, serializer
Constructor and Description |
---|
JRFileVirtualizer(int maxSize)
Uses the process's working directory as the location to store files.
|
JRFileVirtualizer(int maxSize,
String directory) |
JRFileVirtualizer(JasperReportsContext jasperReportsContext,
int maxSize,
String directory) |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Called when we are done with the virtualizer and wish to
cleanup any resources it has.
|
protected void |
dispose(String virtualId)
Removes the external data associated with a virtualizable object.
|
protected void |
pageIn(JRVirtualizable o)
Reads a virtualizable object's data from an external storage.
|
protected void |
pageOut(JRVirtualizable o)
Writes a virtualizable object's data to an external storage.
|
clearData, deregisterObject, dispose, disposeAll, evict, finalize, isEvictable, isPagedOut, isPagedOutAndTouch, isReadOnly, isReadOnly, lastObject, readData, registerObject, requestData, reset, setLastObject, setReadOnly, touch, virtualizeData, writeData
public static final String PROPERTY_TEMP_FILES_SET_DELETE_ON_EXIT
deleteOnExit
should be requested
for temporary files created by the virtualizer.
Calling File.deleteOnExit()
will accumulate JVM process memory
(see this bug), and this
should abviously be avoided in long-running applications.
Temporary files will be deleted by explicitly calling cleanup()
or from the virtualizer
finalize()
method.
public JRFileVirtualizer(int maxSize)
maxSize
- the maximum size (in JRVirtualizable objects) of the paged in
cache.public JRFileVirtualizer(int maxSize, String directory)
maxSize
- the maximum size (in JRVirtualizable objects) of the paged in
cache.directory
- the base directory in the filesystem where the paged out data
is to be storedpublic JRFileVirtualizer(JasperReportsContext jasperReportsContext, int maxSize, String directory)
jasperReportsContext
- the JasperReportsContext to use for reading configuration from.maxSize
- the maximum size (in JRVirtualizable objects) of the paged in
cache.directory
- the base directory in the filesystem where the paged out data
is to be storedprotected void pageOut(JRVirtualizable o) throws IOException
JRAbstractLRUVirtualizer
pageOut
in class JRAbstractLRUVirtualizer
o
- a virtualizable objectIOException
protected void pageIn(JRVirtualizable o) throws IOException
JRAbstractLRUVirtualizer
pageIn
in class JRAbstractLRUVirtualizer
o
- a virtualizable objectIOException
protected void dispose(String virtualId)
JRAbstractLRUVirtualizer
dispose
in class JRAbstractLRUVirtualizer
virtualId
- the ID of the virtualizable objectpublic void cleanup()
Copyright © 2017. All rights reserved.