AdroitLogic UltraESB v1.7.0

org.adroitlogic.ultraesb.core
Class PooledMessageFileCache

java.lang.Object
  extended by org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement
      extended by org.adroitlogic.ultraesb.core.AbstractFileCache
          extended by org.adroitlogic.ultraesb.core.PooledMessageFileCache
All Implemented Interfaces:
ConfigurationElement, FileCache, org.adroitlogic.ultraesb.jmx.element.FileCacheMXBean, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware

public class PooledMessageFileCache
extends org.adroitlogic.ultraesb.core.AbstractFileCache

The default FileCache implementation used by the UltraESB. Allows files to be created on disk, and memory mapped


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.adroitlogic.ultraesb.api.ConfigurationElement
ConfigurationElement.State
 
Field Summary
 
Fields inherited from class org.adroitlogic.ultraesb.core.AbstractFileCache
availableForUse, cachedPath, fileCache, memoryMapEnabled, memoryMapSize, nextFileId, peakUsage, size, stopThreshold, totalFilesCreated, warnThreshold
 
Fields inherited from class org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement
config, ctx, debugOn, derivedName, id, logger, outdated, state
 
Constructor Summary
PooledMessageFileCache(int size)
          Create the specified number of temporary files in the system temporary directory and hold in cache
PooledMessageFileCache(java.lang.String cachedPath, int size)
          Create the specified number of temporary files and hold in cache
PooledMessageFileCache(java.lang.String cachedPath, int size, boolean memoryMapEnabled)
          Create the specified number of temporary files and hold in cache
PooledMessageFileCache(java.lang.String cachedPath, int size, boolean memoryMapEnabled, long memoryMapSize, int warnThreshold, int stopThreshold)
          Create the specified number of temporary files and hold in cache
 
Method Summary
protected  MessageFile createTempFile(java.lang.String prefix, java.lang.String ext, java.io.File cachedPath)
          Create a temporary file with the given prefix and extension, at the given temporary file path
 void setMemoryMapEnabled(boolean memoryMapEnabled)
          Turn memory mapping of temporary files on/or off
 void setMemoryMapSize(long memoryMapSize)
          Set the size of the memory mapping for files
 org.adroitlogic.ultraesb.jmx.view.FileCacheView toDetailedView()
          Return the immutable FileCacheView from JMX.
 
Methods inherited from class org.adroitlogic.ultraesb.core.AbstractFileCache
destroy, getDetails, getFile, registerReadyCallback, returnFile, setStopThreshold, setWarnThreshold, start, stop
 
Methods inherited from class org.adroitlogic.ultraesb.core.config.AbstractConfigurationElement
equals, getAppCtx, getDerivedName, getId, getState, hashCode, isDebugOn, isStarted, maintenanceShutdown, markAsOutdated, pause, resume, setApplicationContext, setBeanName, setConfig, setDebugOn, setDerivedName, setId, setState, throwIllegalStateException, undeploy
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.adroitlogic.ultraesb.api.ConfigurationElement
getDerivedName, getId, getState, isDebugOn, isStarted, maintenanceShutdown, pause, resume
 
Methods inherited from interface org.springframework.beans.factory.BeanNameAware
setBeanName
 

Constructor Detail

PooledMessageFileCache

public PooledMessageFileCache(int size)
Create the specified number of temporary files in the system temporary directory and hold in cache

Parameters:
size - the number of files to create initially

PooledMessageFileCache

public PooledMessageFileCache(java.lang.String cachedPath,
                              int size)
Create the specified number of temporary files and hold in cache

Parameters:
cachedPath - path to create temporary files
size - the number of files to create initially

PooledMessageFileCache

public PooledMessageFileCache(java.lang.String cachedPath,
                              int size,
                              boolean memoryMapEnabled)
Create the specified number of temporary files and hold in cache

Parameters:
cachedPath - path to create temporary files
size - the number of files to create initially
memoryMapEnabled - enable memory mapping

PooledMessageFileCache

public PooledMessageFileCache(java.lang.String cachedPath,
                              int size,
                              boolean memoryMapEnabled,
                              long memoryMapSize,
                              int warnThreshold,
                              int stopThreshold)
Create the specified number of temporary files and hold in cache

Parameters:
cachedPath - path to create temporary files
size - the number of files to create initially
memoryMapEnabled - enable memory mapping
memoryMapSize - size in bytes to map into memory (default 4096)
warnThreshold - issue a warning when this number of files have been created
stopThreshold - maximum number of files to create
Method Detail

createTempFile

protected MessageFile createTempFile(java.lang.String prefix,
                                     java.lang.String ext,
                                     java.io.File cachedPath)
Create a temporary file with the given prefix and extension, at the given temporary file path

Specified by:
createTempFile in class org.adroitlogic.ultraesb.core.AbstractFileCache
Parameters:
prefix - prefix for file names
ext - extension for file names
cachedPath - path to create the temporary files at
Returns:
a new temporary file

setMemoryMapSize

public void setMemoryMapSize(long memoryMapSize)
Set the size of the memory mapping for files

Parameters:
memoryMapSize - the size in bytes to memory map (default is 4K)

setMemoryMapEnabled

public void setMemoryMapEnabled(boolean memoryMapEnabled)
Turn memory mapping of temporary files on/or off

Parameters:
memoryMapEnabled - memory mapping on if true

toDetailedView

public org.adroitlogic.ultraesb.jmx.view.FileCacheView toDetailedView()
Return the immutable FileCacheView from JMX.

Specified by:
toDetailedView in class org.adroitlogic.ultraesb.core.AbstractFileCache
Returns:
the FileCacheView from JMX

Copyright (c) 2010-2012 AdroitLogic Private Ltd. All rights reserved.