|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jasperreports.engine.fill.JRAbstractLRUVirtualizer
net.sf.jasperreports.engine.fill.JRFileVirtualizer
public class JRFileVirtualizer
Virtualizes data to the filesystem. When this object is finalized, it removes the swap files it makes. The virtualized objects have references to this object, so finalization does not occur until this object and the objects using it are only weakly referenced.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.fill.JRAbstractLRUVirtualizer |
---|
JRAbstractLRUVirtualizer.Cache, JRAbstractLRUVirtualizer.CacheReference, JRAbstractLRUVirtualizer.ClassLoaderAnnotationObjectInputStream, JRAbstractLRUVirtualizer.ClassLoaderAnnotationObjectOutputStream |
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_TEMP_FILES_SET_DELETE_ON_EXIT
Property used to decide whether deleteOnExit should be requested
for temporary files created by the virtualizer. |
Fields inherited from class net.sf.jasperreports.engine.fill.JRAbstractLRUVirtualizer |
---|
CLASSLOADER_IDX_NOT_SET, classLoadersIndexes, classLoadersList, lastObject, lastObjectMap, lastObjectSet |
Constructor Summary | |
---|---|
JRFileVirtualizer(int maxSize)
Uses the process's working directory as the location to store files. |
|
JRFileVirtualizer(int maxSize,
java.lang.String directory)
|
Method Summary | |
---|---|
void |
cleanup()
Called when we are done with the virtualizer and wish to cleanup any resources it has. |
protected void |
dispose(java.lang.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. |
Methods inherited from class net.sf.jasperreports.engine.fill.JRAbstractLRUVirtualizer |
---|
clearData, deregisterObject, disposeAll, finalize, isAncestorClassLoader, isPagedOut, isPagedOutAndTouch, isReadOnly, isReadOnly, readData, registerObject, requestData, reset, setLastObject, setReadOnly, touch, virtualizeData, writeData |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.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.
Constructor Detail |
---|
public JRFileVirtualizer(int maxSize)
maxSize
- the maximum size (in JRVirtualizable objects) of the paged in
cache.public JRFileVirtualizer(int maxSize, java.lang.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 storedMethod Detail |
---|
protected void pageOut(JRVirtualizable o) throws java.io.IOException
JRAbstractLRUVirtualizer
pageOut
in class JRAbstractLRUVirtualizer
o
- a virtualizable object
java.io.IOException
protected void pageIn(JRVirtualizable o) throws java.io.IOException
JRAbstractLRUVirtualizer
pageIn
in class JRAbstractLRUVirtualizer
o
- a virtualizable object
java.io.IOException
protected void dispose(java.lang.String virtualId)
JRAbstractLRUVirtualizer
dispose
in class JRAbstractLRUVirtualizer
virtualId
- the ID of the virtualizable objectpublic void cleanup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |