|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.mq.server.MessageCache
This class implements a Message cache so that larger amounts of messages
can be processed without running out of memory. When memory starts getting tight
it starts moving messages out of memory and into a file so that they can be recovered
later.
The locks should be obtained in the following order:
mr, the relevent message we are working with
lruCache, when maintaining the usage order
| Field Summary | |
static long |
DEFAULT_HIGH_MEMORY_MARK
|
static long |
DEFAULT_MAX_MEMORY_MARK
|
static long |
ONE_MEGABYTE
|
| Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
| Fields inherited from interface org.jboss.mq.server.MessageCacheMBean |
OBJECT_NAME |
| Fields inherited from interface org.jboss.system.ServiceMBean |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
| Constructor Summary | |
MessageCache()
|
|
| Method Summary | |
MessageReference |
add(SpyMessage message)
Adds a message to the cache |
MessageReference |
add(SpyMessage message,
BasicQueue queue,
int stored)
Adds a message to the cache. |
MessageReference |
add(SpyMessage message,
BasicQueue queue,
int stored,
DurableSubscriptionID id)
Adds a message to the cache. |
MessageReference |
addInternal(SpyMessage message,
BasicQueue queue,
int stored,
DurableSubscriptionID id)
Adds a message to the cache. |
long |
getCacheHits()
Gets the cacheHits |
long |
getCacheMisses()
Gets the cacheMisses |
javax.management.ObjectName |
getCacheStore()
The getCacheStore method |
long |
getCurrentMemoryUsage()
Gets the CurrentMemoryUsage |
int |
getHardRefCacheSize()
Gets the hardRefCacheSize |
long |
getHighMemoryMark()
Gets the highMemoryMark |
MessageCache |
getInstance()
The getInstance method |
boolean |
getMakeSoftReferences()
Gets whether to make soft references |
int |
getMaximumHard()
Gets the maximum number of hard messages |
long |
getMaxMemoryMark()
Gets the maxMemoryMark |
int |
getMinimumHard()
Gets the minimum number of hard messages |
String |
getName()
|
long |
getSoftenAtLeastEveryMillis()
Gets the maximum length between softening checks |
long |
getSoftenedSize()
The getSoftenedSize method |
long |
getSoftenNoMoreOftenThanMillis()
Gets the minimum length between softening checks |
long |
getSoftenWaitMillis()
Gets the length of time to wait before checking whether we should soften |
int |
getSoftRefCacheSize()
Gets the softRefCacheSize |
int |
getTotalCacheSize()
Gets the totalCacheSize |
void |
remove(MessageReference mr)
removes a message from the cache |
void |
removeDelayed(MessageReference mr)
removes a message from the cache without returning it to the pool used in two phase removes for joint cache/persistence |
protected void |
removeInternal(MessageReference mr,
boolean clear,
boolean reset)
removes a message from the cache |
void |
run()
The strategy is that we keep the most recently used messages as Hard references. |
void |
setCacheStore(javax.management.ObjectName cacheStoreName)
|
void |
setHighMemoryMark(long highMemoryMark)
Sets the highMemoryMark |
void |
setMakeSoftReferences(boolean makeSoftReferences)
Sets whether to make soft references |
void |
setMaximumHard(int maximumHard)
Sets the maximum number of hard messages |
void |
setMaxMemoryMark(long maxMemoryMark)
Sets the maxMemoryMark |
void |
setMinimumHard(int minimumHard)
Sets the minimum number of hard messages |
void |
setSoftenAtLeastEveryMillis(long millis)
Sets the minimum length between softening checks |
void |
setSoftenNoMoreOftenThanMillis(long millis)
Sets the minimum length between softening checks |
void |
setSoftenWaitMillis(long millis)
Sets the length of time to wait before checking whether we should soften |
protected void |
startService()
This gets called to start the cache service. |
protected void |
stopService()
This gets called to stop the cache service. |
| Methods inherited from class org.jboss.system.ServiceMBeanSupport |
create, createService, destroy, destroyService, getLog, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
| Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jboss.system.ServiceMBean |
getState, getStateString, jbossInternalLifecycle |
| Methods inherited from interface org.jboss.system.Service |
create, destroy, start, stop |
| Methods inherited from interface javax.management.MBeanRegistration |
postDeregister, postRegister, preDeregister, preRegister |
| Field Detail |
public static final long ONE_MEGABYTE
public static final long DEFAULT_HIGH_MEMORY_MARK
public static final long DEFAULT_MAX_MEMORY_MARK
| Constructor Detail |
public MessageCache()
| Method Detail |
public MessageCache getInstance()
getInstance method
getInstance in interface MessageCacheMBeanMessageCache valuepublic MessageReference add(SpyMessage message) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic MessageReference add(SpyMessage message, BasicQueue queue, int stored) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic MessageReference add(SpyMessage message, BasicQueue queue, int stored, DurableSubscriptionID id) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic MessageReference addInternal(SpyMessage message, BasicQueue queue, int stored, DurableSubscriptionID id) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void remove(MessageReference mr) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void removeDelayed(MessageReference mr) throws javax.jms.JMSException
javax.jms.JMSExceptionprotected void removeInternal(MessageReference mr, boolean clear, boolean reset) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void run()
Runnable.run()
protected void startService()
throws Exception
Exceptionprotected void stopService()
public int getHardRefCacheSize()
getHardRefCacheSize in interface MessageCacheMBeanpublic long getSoftenedSize()
getSoftenedSize method
getSoftenedSize in interface MessageCacheMBeanlong valuepublic int getSoftRefCacheSize()
getSoftRefCacheSize in interface MessageCacheMBeanpublic int getTotalCacheSize()
getTotalCacheSize in interface MessageCacheMBeanpublic long getCacheMisses()
getCacheMisses in interface MessageCacheMBeanpublic long getCacheHits()
getCacheHits in interface MessageCacheMBeanpublic boolean getMakeSoftReferences()
getMakeSoftReferences in interface MessageCacheMBeanpublic void setMakeSoftReferences(boolean makeSoftReferences)
setMakeSoftReferences in interface MessageCacheMBeanpublic int getMinimumHard()
getMinimumHard in interface MessageCacheMBeanpublic void setMinimumHard(int minimumHard)
setMinimumHard in interface MessageCacheMBeanminimumHard - the minimum number of hard messagespublic int getMaximumHard()
getMaximumHard in interface MessageCacheMBeanpublic void setMaximumHard(int maximumHard)
setMaximumHard in interface MessageCacheMBeanmaximumHard - the maximum number of hard messagespublic long getSoftenWaitMillis()
getSoftenWaitMillis in interface MessageCacheMBeanpublic void setSoftenWaitMillis(long millis)
setSoftenWaitMillis in interface MessageCacheMBeanmillis - the time to wait in millispublic long getSoftenNoMoreOftenThanMillis()
getSoftenNoMoreOftenThanMillis in interface MessageCacheMBeanpublic void setSoftenNoMoreOftenThanMillis(long millis)
setSoftenNoMoreOftenThanMillis in interface MessageCacheMBeanpublic long getSoftenAtLeastEveryMillis()
getSoftenAtLeastEveryMillis in interface MessageCacheMBeanpublic void setSoftenAtLeastEveryMillis(long millis)
setSoftenAtLeastEveryMillis in interface MessageCacheMBeanpublic long getHighMemoryMark()
getHighMemoryMark in interface MessageCacheMBeanpublic void setHighMemoryMark(long highMemoryMark)
setHighMemoryMark in interface MessageCacheMBeanhighMemoryMark - The highMemoryMark to setpublic long getMaxMemoryMark()
getMaxMemoryMark in interface MessageCacheMBeanpublic void setMaxMemoryMark(long maxMemoryMark)
setMaxMemoryMark in interface MessageCacheMBeanmaxMemoryMark - The maxMemoryMark to setpublic long getCurrentMemoryUsage()
getCurrentMemoryUsage in interface MessageCacheMBeanpublic String getName()
getName in interface org.jboss.system.ServiceMBeanServiceMBeanSupport.getName()public void setCacheStore(javax.management.ObjectName cacheStoreName)
setCacheStore in interface MessageCacheMBeanpublic javax.management.ObjectName getCacheStore()
getCacheStore method
getCacheStore in interface MessageCacheMBeanObjectName value
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||