return isVirtualizationActive;
}
public JRVirtualizer getVirtualizer() {
JRSwapFileVirtualizer virtualizer;
int maxSize = 2;
String maxSizeStr = (String)getConfigSourceBean().getAttribute("VIRTUALIZER.maxSize");
if(maxSizeStr != null) {
maxSize = Integer.parseInt(maxSizeStr);
}
File virtualizationDir;
String virtualizationDirPath = (String)getConfigSourceBean().getAttribute("VIRTUALIZER.dir");
virtualizationDir = null;
if(virtualizationDirPath == null){
virtualizationDir = new File(getTempDir(), "virtualization");
} else {
if(!virtualizationDirPath.startsWith("/")) {
virtualizationDir = new File(getTempDir(), virtualizationDirPath);
} else {
virtualizationDir = new File(virtualizationDirPath);
}
}
virtualizationDir = new File(virtualizationDir, "jrcache");
virtualizationDir.mkdirs();
logger.debug("Max page cached during virtualization process: " + maxSize);
logger.debug("Dir used as storing area during virtualization: " + virtualizationDir);
JRSwapFile swapFile = new JRSwapFile(virtualizationDir.getAbsolutePath(), maxSize, maxSize);
virtualizer = new JRSwapFileVirtualizer(maxSize, swapFile);
virtualizer.setReadOnly(false);
return virtualizer;
}