mirror of https://github.com/apache/activemq.git
chekc if debug is enabled before calling debug
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@511073 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8cf4795b94
commit
48522098f5
|
@ -54,6 +54,7 @@ public class UsageManager {
|
|||
|
||||
/** True if someone called setSendFailIfNoSpace() on this particular usage manager */
|
||||
private boolean sendFailIfNoSpaceExplicitySet;
|
||||
private final boolean debug = log.isDebugEnabled();
|
||||
|
||||
public UsageManager() {
|
||||
this(null);
|
||||
|
@ -242,22 +243,21 @@ public class UsageManager {
|
|||
return (int)((((usage*100)/limit)/percentUsageMinDelta)*percentUsageMinDelta);
|
||||
}
|
||||
|
||||
private void fireEvent(int oldPercentUsage, int newPercentUsage) {
|
||||
|
||||
log.debug("Memory usage change. from: "+oldPercentUsage+", to: "+newPercentUsage);
|
||||
|
||||
private void fireEvent(int oldPercentUsage,int newPercentUsage){
|
||||
if (debug) {
|
||||
log.debug("Memory usage change. from: "+oldPercentUsage+", to: "+newPercentUsage);
|
||||
}
|
||||
// Switching from being full to not being full..
|
||||
if( oldPercentUsage >= 100 && newPercentUsage < 100 ) {
|
||||
synchronized (usageMutex) {
|
||||
if(oldPercentUsage>=100&&newPercentUsage<100){
|
||||
synchronized(usageMutex){
|
||||
usageMutex.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Let the listeners know
|
||||
for (Iterator iter = listeners.iterator(); iter.hasNext();) {
|
||||
UsageListener l = (UsageListener) iter.next();
|
||||
l.onMemoryUseChanged(this, oldPercentUsage, newPercentUsage);
|
||||
// Let the listeners know
|
||||
for(Iterator iter=listeners.iterator();iter.hasNext();){
|
||||
UsageListener l=(UsageListener)iter.next();
|
||||
l.onMemoryUseChanged(this,oldPercentUsage,newPercentUsage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
|
Loading…
Reference in New Issue