|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
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 (src) |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean (src) |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
MessageCache()
|
Method Summary | |
MessageReference (src) |
add(SpyMessage (src) message,
BasicQueue (src) queue,
int stored)
Adds a message to the cache. |
MessageReference (src) |
add(SpyMessage (src) message,
BasicQueue (src) queue,
int stored,
DurableSubscriptionID (src) id)
Adds a message to the cache. |
MessageReference (src) |
addInternal(SpyMessage (src) message,
BasicQueue (src) queue,
int stored,
DurableSubscriptionID (src) id)
Adds a message to the cache. |
long |
getCacheHits()
Gets the cacheHits |
long |
getCacheMisses()
Gets the cacheMisses |
ObjectName (src) |
getCacheStore()
The getCacheStore method |
long |
getCurrentMemoryUsage()
Gets the CurrentMemoryUsage |
int |
getHardRefCacheSize()
Gets the hardRefCacheSize |
long |
getHighMemoryMark()
Gets the highMemoryMark |
MessageCache (src) |
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 |
java.lang.String |
getName()
Use the short class name as the default for the service name. |
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 (src) mr)
removes a message from the cache |
void |
removeDelayed(MessageReference (src) 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 (src) 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(ObjectName (src) 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 (src) |
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 (src) |
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 javax.management.MBeanRegistration (src) |
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 (src) getInstance()
getInstance
method
MessageCache
valuepublic MessageReference (src) add(SpyMessage (src) message, BasicQueue (src) queue, int stored) throws JMSException (src)
JMSException (src)
public MessageReference (src) add(SpyMessage (src) message, BasicQueue (src) queue, int stored, DurableSubscriptionID (src) id) throws JMSException (src)
JMSException (src)
public MessageReference (src) addInternal(SpyMessage (src) message, BasicQueue (src) queue, int stored, DurableSubscriptionID (src) id) throws JMSException (src)
JMSException (src)
public void remove(MessageReference (src) mr) throws JMSException (src)
JMSException (src)
public void removeDelayed(MessageReference (src) mr) throws JMSException (src)
JMSException (src)
protected void removeInternal(MessageReference (src) mr, boolean clear, boolean reset) throws JMSException (src)
JMSException (src)
public void run()
run
in interface java.lang.Runnable
Runnable.run()
protected void startService() throws java.lang.Exception
startService
in class ServiceMBeanSupport (src)
java.lang.Exception
protected void stopService()
stopService
in class ServiceMBeanSupport (src)
public int getHardRefCacheSize()
public long getSoftenedSize()
getSoftenedSize
method
long
valuepublic int getSoftRefCacheSize()
public int getTotalCacheSize()
public long getCacheMisses()
public long getCacheHits()
public boolean getMakeSoftReferences()
public void setMakeSoftReferences(boolean makeSoftReferences)
public int getMinimumHard()
public void setMinimumHard(int minimumHard)
minimumHard
- the minimum number of hard messagespublic int getMaximumHard()
public void setMaximumHard(int maximumHard)
maximumHard
- the maximum number of hard messagespublic long getSoftenWaitMillis()
public void setSoftenWaitMillis(long millis)
millis
- the time to wait in millispublic long getSoftenNoMoreOftenThanMillis()
public void setSoftenNoMoreOftenThanMillis(long millis)
public long getSoftenAtLeastEveryMillis()
public void setSoftenAtLeastEveryMillis(long millis)
public long getHighMemoryMark()
public void setHighMemoryMark(long highMemoryMark)
highMemoryMark
- The highMemoryMark to setpublic long getMaxMemoryMark()
public void setMaxMemoryMark(long maxMemoryMark)
maxMemoryMark
- The maxMemoryMark to setpublic long getCurrentMemoryUsage()
public java.lang.String getName()
ServiceMBeanSupport (src)
getName
in interface ServiceMBean (src)
getName
in class ServiceMBeanSupport (src)
ServiceMBeanSupport.getName()
public void setCacheStore(ObjectName (src) cacheStoreName)
MessageCacheMBean#setCacheStore(ObjectName)
public ObjectName (src) getCacheStore()
getCacheStore
method
ObjectName
value
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |