net.sf.jasperreports.engine.fill

Class JRSwapFileVirtualizer

Implemented Interfaces:
JRVirtualizer

public class JRSwapFileVirtualizer
extends JRAbstractLRUVirtualizer

A virtualizer that uses a single swap file to serialize virtual data.

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

Fields inherited from class net.sf.jasperreports.engine.fill.JRAbstractLRUVirtualizer

CLASSLOADER_IDX_NOT_SET, classLoadersIndexes, classLoadersList, lastObject, lastObjectMap, lastObjectSet

Constructor Summary

JRSwapFileVirtualizer(int maxSize, JRSwapFile swap)
Creates a virtualizer that uses a swap file.
JRSwapFileVirtualizer(int maxSize, JRSwapFile swap, boolean swapOwner)
Creates a virtualizer that uses a swap file.

Method Summary

void
cleanup()
Disposes the swap file used if this virtualizer owns it.
protected void
dispose(String id)
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, dispose, disposeAll, finalize, isAncestorClassLoader, isPagedOut, isPagedOutAndTouch, isReadOnly, isReadOnly, pageIn, pageOut, readData, registerObject, requestData, reset, setLastObject, setReadOnly, touch, virtualizeData, writeData

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

JRSwapFileVirtualizer

public JRSwapFileVirtualizer(int maxSize,
                             JRSwapFile swap)
Creates a virtualizer that uses a swap file.

The virtualizer will be considered the owner of the swap file.

Parameters:
maxSize - the maximum size (in JRVirtualizable objects) of the paged in cache.
swap - the swap file to use for data virtualization

JRSwapFileVirtualizer

public JRSwapFileVirtualizer(int maxSize,
                             JRSwapFile swap,
                             boolean swapOwner)
Creates a virtualizer that uses a swap file.
Parameters:
maxSize - the maximum size (in JRVirtualizable objects) of the paged in cache.
swap - the swap file to use for data virtualization
swapOwner - whether the virtualizer is the owner (single user) of the swap file. If true, the virtualizer will dispose the swap file on cleanup.

Method Details

cleanup

public void cleanup()
Disposes the swap file used if this virtualizer owns it.
Specified by:
cleanup in interface JRVirtualizer

dispose

protected void dispose(String id)
Removes the external data associated with a virtualizable object.
Overrides:
dispose in interface JRAbstractLRUVirtualizer
Parameters:

pageIn

protected void pageIn(JRVirtualizable o)
            throws IOException
Reads a virtualizable object's data from an external storage.
Overrides:
pageIn in interface JRAbstractLRUVirtualizer
Parameters:
o - a virtualizable object
Throws:
IOException -

pageOut

protected void pageOut(JRVirtualizable o)
            throws IOException
Writes a virtualizable object's data to an external storage.
Overrides:
pageOut in interface JRAbstractLRUVirtualizer
Parameters:
o - a virtualizable object
Throws:
IOException -