Top Description Fields Constructors Methods
net.sf.ehcache.management.sampled

public Class SampledCacheManager

extends BaseEmitterBean
implements SampledCacheManagerMBean
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.management.sampled.SampledCacheManagerMBean, net.sf.ehcache.management.sampled.CacheManagerSampler
Imports
net.sf.ehcache.CacheException, .CacheManager, net.sf.ehcache.hibernate.management.impl.BaseEmitterBean, java.util.HashMap, .Map, javax.management.MBeanNotificationInfo, .NotCompliantMBeanException, .Notification

An implementation of SampledCacheManagerMBean
Authors
Abhishek Sanoujam, byoukste

Field Summary

Modifier and TypeField and Description
private String
private volatile boolean
private static final MBeanNotificationInfo[]
private final CacheManagerSampler
Inherited from net.sf.ehcache.hibernate.management.impl.BaseEmitterBean:
emittersequenceNumber

Constructor Summary

AccessConstructor and Description
public
SampledCacheManager(CacheManager
the cacheManager to wrap
cacheManager
)

Constructor taking the backing CacheManager

Method Summary

Modifier and TypeMethod and Description
public void
clearAll()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.clearAll.

Clears the contents of all caches in the CacheManager, but without removing any caches.
protected void
doDispose()

Implements abstract net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.doDispose.

Dispose callback of subclasses
public Object[][]
executeQuery(String queryString)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.executeQuery.

Execute a BMSQL query against the CacheManager and return result grid.
public String

Returns:

CacheManager configuration as String
generateActiveConfigDeclaration
()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.generateActiveConfigDeclaration.

generateActiveConfigDeclaration
public String

Returns:

Cache configuration as String
generateActiveConfigDeclaration
(String cacheName)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.generateActiveConfigDeclaration.

generateActiveConfigDeclaration
public float
public long
public long
public long
public long
public long
public long
private Map<String, Object>
public Map<String, long[]>

Returns:

map of cache metrics (hits, misses)
getCacheMetrics
()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMetrics.

Get a map of cache name to performance metrics (hits, misses).
public long
public String[]
getCacheNames()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheNames.

Gets the cache names managed by the CacheManager
public long
public long
public long
public long
public long
public long
public long
public long
public String
public boolean
getHasWriteBehindWriter()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getHasWriteBehindWriter.

Returns whether any caches are configured for write-behind
public long
getMaxBytesLocalDisk()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDisk.

Maximum number of bytes of entries in the disk stores of all caches that did not declare their own max size.
public String
public long
getMaxBytesLocalHeap()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeap.

Maximum number of bytes of entries in the heap memory stores of all caches that did not declare their own max size.
public String
public long
getMaxBytesLocalOffHeap()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeap.

Maximum number of bytes of entries in the off-heap stores of all caches that did not declare their own max size.
public String
public String
public String
getName()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getName.

Gets the actual name of the cache manager.
public MBeanNotificationInfo[]
getNotificationInfo()

Implements abstract net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

public boolean
public String
getStatus()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getStatus.

Gets the status attribute of the Ehcache
public boolean
public long
public long
public long
public long
public long
public int
getWriterMaxQueueSize()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getWriterMaxQueueSize.

Maximum elements that can be queued for processing by the write-behind writer
public long

Returns:

aggregate writer queue length
getWriterQueueLength
()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getWriterQueueLength.

Returns the total length of all write-behind queues across all caches
public boolean
isEnabled()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.isEnabled.

Returns if each contained cache is enabled.
public void
setEnabled(boolean enabled)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.setEnabled.

Enables/disables each of the contained caches.
public void
public void
public void
public void
pack-priv void
setMBeanRegisteredName(String
the MBean name to be registered.
name
)

Set the name used to register this mbean.

public void
Inherited from net.sf.ehcache.hibernate.management.impl.BaseEmitterBean:
addNotificationListenerdisposeremoveNotificationListenerremoveNotificationListenersendNotificationsendNotificationsendNotification

Field Detail

mbeanRegisteredNameback to summary
private String mbeanRegisteredName
mbeanRegisteredNameSetback to summary
private volatile boolean mbeanRegisteredNameSet
NOTIFICATION_INFOback to summary
private static final MBeanNotificationInfo[] NOTIFICATION_INFO
sampledCacheManagerDelegateback to summary
private final CacheManagerSampler sampledCacheManagerDelegate

Constructor Detail

SampledCacheManagerback to summary
public SampledCacheManager(CacheManager cacheManager) throws NotCompliantMBeanException

Constructor taking the backing CacheManager

Parameters
cacheManager:CacheManager

the cacheManager to wrap

Exceptions
NotCompliantMBeanException:
if invalid object is registered

Method Detail

clearAllback to summary
public void clearAll()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.clearAll.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.clearAll.

Clears the contents of all caches in the CacheManager, but without removing any caches.

This method is not synchronized. It only guarantees to clear those elements in a cache at the time that the net.sf.ehcache.Ehcache#removeAll() mehod on each cache is called.

doDisposeback to summary
protected void doDispose()

Implements abstract net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.doDispose.

Doc from net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.doDispose.

Dispose callback of subclasses

Annotations
@Override
executeQueryback to summary
public Object[][] executeQuery(String queryString)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.executeQuery.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.executeQuery.

Execute a BMSQL query against the CacheManager and return result grid.

Returns:Object[][]

query result grid

Annotations
@Override
generateActiveConfigDeclarationback to summary
public String generateActiveConfigDeclaration()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.generateActiveConfigDeclaration.

generateActiveConfigDeclaration

Returns:String

CacheManager configuration as String

generateActiveConfigDeclarationback to summary
public String generateActiveConfigDeclaration(String cacheName)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.generateActiveConfigDeclaration.

generateActiveConfigDeclaration

Returns:String

Cache configuration as String

getCacheAverageGetTimeback to summary
public float getCacheAverageGetTime()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheAverageGetTime.

Returns:float

aggregate average get time (ms.)

getCacheAverageSearchTimeback to summary
public long getCacheAverageSearchTime()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheAverageSearchTime.

Returns:long

aggregate search time

getCacheEvictionRateback to summary
public long getCacheEvictionRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheEvictionRate.

Returns:long

aggregate eviction rate

getCacheExpirationRateback to summary
public long getCacheExpirationRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheExpirationRate.

Returns:long

aggregate expiration rate

getCacheHitRateback to summary
public long getCacheHitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheHitRate.

Returns:long

aggregate hit rate

getCacheInMemoryHitRateback to summary
public long getCacheInMemoryHitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheInMemoryHitRate.

Returns:long

aggregate in-memory hit rate

getCacheInMemoryMissRateback to summary
public long getCacheInMemoryMissRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheInMemoryMissRate.

Returns:long

aggregate in-memory miss rate

getCacheManagerAttributesback to summary
private Map<String, Object> getCacheManagerAttributes()
getCacheMetricsback to summary
public Map<String, long[]> getCacheMetrics()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMetrics.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMetrics.

Get a map of cache name to performance metrics (hits, misses).

Returns:Map<String, long[]>

map of cache metrics (hits, misses)

getCacheMissRateback to summary
public long getCacheMissRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheMissRate.

Returns:long

aggregate miss rate

getCacheNamesback to summary
public String[] getCacheNames() throws IllegalStateException

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheNames.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheNames.

Gets the cache names managed by the CacheManager

getCacheOffHeapHitRateback to summary
public long getCacheOffHeapHitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOffHeapHitRate.

Returns:long

aggregate off-heap hit rate

getCacheOffHeapMissRateback to summary
public long getCacheOffHeapMissRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOffHeapMissRate.

Returns:long

aggregate off-heap miss rate

getCacheOnDiskHitRateback to summary
public long getCacheOnDiskHitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOnDiskHitRate.

Returns:long

aggregate on-disk hit rate

getCacheOnDiskMissRateback to summary
public long getCacheOnDiskMissRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheOnDiskMissRate.

Returns:long

aggregate on-disk miss rate

getCachePutRateback to summary
public long getCachePutRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCachePutRate.

Returns:long

aggregate put rate

getCacheRemoveRateback to summary
public long getCacheRemoveRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheRemoveRate.

Returns:long

aggregate remove rate

getCacheSearchRateback to summary
public long getCacheSearchRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheSearchRate.

Returns:long

aggregate search rate

getCacheUpdateRateback to summary
public long getCacheUpdateRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getCacheUpdateRate.

Returns:long

aggregate update rate

getClusterUUIDback to summary
public String getClusterUUID()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getClusterUUID.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getClusterUUID.

Gets the cluster uuid if applicable.

Returns:String

the cluster uuid

See Also
net.sf.ehcache.management.sampled.SampledCacheManager#getClusterUUID()
getHasWriteBehindWriterback to summary
public boolean getHasWriteBehindWriter()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getHasWriteBehindWriter.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getHasWriteBehindWriter.

Returns whether any caches are configured for write-behind

getMaxBytesLocalDiskback to summary
public long getMaxBytesLocalDisk()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDisk.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDisk.

Maximum number of bytes of entries in the disk stores of all caches that did not declare their own max size.

Returns:long

maximum number of bytes in the disk stores of all caches that did not declare their own max size.

getMaxBytesLocalDiskAsStringback to summary
public String getMaxBytesLocalDiskAsString()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDiskAsString.

Returns:String

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalDiskAsString.

Original input for maxBytesLocalDisk

getMaxBytesLocalHeapback to summary
public long getMaxBytesLocalHeap()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeap.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeap.

Maximum number of bytes of entries in the heap memory stores of all caches that did not declare their own max size.

Returns:long

maximum number of bytes in the heap memory stores of all caches that did not declare their own max size.

getMaxBytesLocalHeapAsStringback to summary
public String getMaxBytesLocalHeapAsString()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeapAsString.

Returns:String

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalHeapAsString.

Original input for maxBytesLocalHeap

getMaxBytesLocalOffHeapback to summary
public long getMaxBytesLocalOffHeap()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeap.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeap.

Maximum number of bytes of entries in the off-heap stores of all caches that did not declare their own max size.

Returns:long

maximum number of bytes in the off-heap stores of all caches that did not declare their own max size.

getMaxBytesLocalOffHeapAsStringback to summary
public String getMaxBytesLocalOffHeapAsString()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeapAsString.

Returns:String

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getMaxBytesLocalOffHeapAsString.

Original input for maxBytesLocalOffHeap

getMBeanRegisteredNameback to summary
public String getMBeanRegisteredName()

Implements net.sf.ehcache.management.sampled.SampledCacheManagerMBean.getMBeanRegisteredName.

Doc from net.sf.ehcache.management.sampled.SampledCacheManagerMBean.getMBeanRegisteredName.

Gets the name used to register this mbean.

See Also
net.sf.ehcache.management.sampled.SampledCacheManagerMBean#getName()
getNameback to summary
public String getName()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getName.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getName.

Gets the actual name of the cache manager.

See Also
net.sf.ehcache.management.sampled.SampledCacheManager#getName()
getNotificationInfoback to summary
public MBeanNotificationInfo[] getNotificationInfo()

Implements abstract net.sf.ehcache.hibernate.management.impl.BaseEmitterBean.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

Doc from javax.management.NotificationBroadcaster.getNotificationInfo.

Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.

Returns:MBeanNotificationInfo[]

the array of possible notifications.

Annotations
@Override
See Also
BaseEmitterBean#getNotificationInfo()
getSearchableback to summary
public boolean getSearchable()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getSearchable.

Returns:boolean

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getSearchable.

if any contained caches are configured for search

getStatusback to summary
public String getStatus()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getStatus.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getStatus.

Gets the status attribute of the Ehcache

Returns:String

The status value, as a String from the Status enum class

getTransactionalback to summary
public boolean getTransactional()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactional.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactional.

Are any of the caches transactional

getTransactionCommitRateback to summary
public long getTransactionCommitRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionCommitRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionCommitRate.

aggregate Xa commit rate

getTransactionCommittedCountback to summary
public long getTransactionCommittedCount()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionCommittedCount.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionCommittedCount.

Get the committed transactions count

Returns:long

the committed transactions count

getTransactionRollbackRateback to summary
public long getTransactionRollbackRate()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionRollbackRate.

Returns:long

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionRollbackRate.

aggregate Xa rollback rate

getTransactionRolledBackCountback to summary
public long getTransactionRolledBackCount()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionRolledBackCount.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionRolledBackCount.

Get the rolled back transactions count

Returns:long

the rolled back transactions count

getTransactionTimedOutCountback to summary
public long getTransactionTimedOutCount()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionTimedOutCount.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getTransactionTimedOutCount.

Get the timed out transactions count. Note that only transactions which failed to commit due to a timeout are taken into account

Returns:long

the timed out transactions count

getWriterMaxQueueSizeback to summary
public int getWriterMaxQueueSize()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getWriterMaxQueueSize.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getWriterMaxQueueSize.

Maximum elements that can be queued for processing by the write-behind writer

Returns:int

aggregate of the maximum elements that can be waiting to be processed by the write-behind writer across all caches

getWriterQueueLengthback to summary
public long getWriterQueueLength()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.getWriterQueueLength.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.getWriterQueueLength.

Returns the total length of all write-behind queues across all caches

Returns:long

aggregate writer queue length

isEnabledback to summary
public boolean isEnabled() throws CacheException

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.isEnabled.

Returns if each contained cache is enabled.

Returns:boolean

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.isEnabled.

boolean indicating that each cache is enabled

setEnabledback to summary
public void setEnabled(boolean enabled)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.setEnabled.

Enables/disables each of the contained caches.

setMaxBytesLocalDiskback to summary
public void setMaxBytesLocalDisk(long maxBytes)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.setMaxBytesLocalDisk.

setMaxBytesLocalDiskAsStringback to summary
public void setMaxBytesLocalDiskAsString(String maxBytes)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.setMaxBytesLocalDiskAsString.

setMaxBytesLocalHeapback to summary
public void setMaxBytesLocalHeap(long maxBytes)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.setMaxBytesLocalHeap.

setMaxBytesLocalHeapAsStringback to summary
public void setMaxBytesLocalHeapAsString(String maxBytes)

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.setMaxBytesLocalHeapAsString.

setMBeanRegisteredNameback to summary
pack-priv void setMBeanRegisteredName(String name)

Set the name used to register this mbean. Can be called only once. Package protected method

Parameters
name:String

the MBean name to be registered.

shutdownback to summary
public void shutdown()

Implements net.sf.ehcache.management.sampled.CacheManagerSampler.shutdown.

Doc from net.sf.ehcache.management.sampled.CacheManagerSampler.shutdown.

Shuts down the CacheManager.

If the shutdown occurs on the singleton, then the singleton is removed, so that if a singleton access method is called, a new singleton will be created.