loosen synchronization around parameter setting - to reduce contention

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@649579 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-04-18 15:45:29 +00:00
parent 4c125db790
commit 0326ab7d44
2 changed files with 15 additions and 15 deletions

View File

@ -251,7 +251,7 @@ public class StoreDurableSubscriberCursor extends AbstractPendingMessageCursor {
return pendingCount; return pendingCount;
} }
public synchronized void setMaxBatchSize(int maxBatchSize) { public void setMaxBatchSize(int maxBatchSize) {
for (Iterator<PendingMessageCursor> i = storePrefetches.iterator(); i.hasNext();) { for (Iterator<PendingMessageCursor> i = storePrefetches.iterator(); i.hasNext();) {
AbstractPendingMessageCursor tsp = (AbstractPendingMessageCursor)i.next(); AbstractPendingMessageCursor tsp = (AbstractPendingMessageCursor)i.next();
tsp.setMaxBatchSize(maxBatchSize); tsp.setMaxBatchSize(maxBatchSize);
@ -266,7 +266,7 @@ public class StoreDurableSubscriberCursor extends AbstractPendingMessageCursor {
} }
} }
public synchronized void setSystemUsage(SystemUsage usageManager) { public void setSystemUsage(SystemUsage usageManager) {
super.setSystemUsage(usageManager); super.setSystemUsage(usageManager);
for (Iterator<PendingMessageCursor> i = storePrefetches.iterator(); i.hasNext();) { for (Iterator<PendingMessageCursor> i = storePrefetches.iterator(); i.hasNext();) {
PendingMessageCursor tsp = i.next(); PendingMessageCursor tsp = i.next();
@ -274,28 +274,28 @@ public class StoreDurableSubscriberCursor extends AbstractPendingMessageCursor {
} }
} }
public synchronized void setMaxProducersToAudit(int maxProducersToAudit) { public void setMaxProducersToAudit(int maxProducersToAudit) {
super.setMaxProducersToAudit(maxProducersToAudit); super.setMaxProducersToAudit(maxProducersToAudit);
for (PendingMessageCursor cursor : storePrefetches) { for (PendingMessageCursor cursor : storePrefetches) {
cursor.setMaxAuditDepth(maxAuditDepth); cursor.setMaxAuditDepth(maxAuditDepth);
} }
} }
public synchronized void setMaxAuditDepth(int maxAuditDepth) { public void setMaxAuditDepth(int maxAuditDepth) {
super.setMaxAuditDepth(maxAuditDepth); super.setMaxAuditDepth(maxAuditDepth);
for (PendingMessageCursor cursor : storePrefetches) { for (PendingMessageCursor cursor : storePrefetches) {
cursor.setMaxAuditDepth(maxAuditDepth); cursor.setMaxAuditDepth(maxAuditDepth);
} }
} }
public synchronized void setEnableAudit(boolean enableAudit) { public void setEnableAudit(boolean enableAudit) {
super.setEnableAudit(enableAudit); super.setEnableAudit(enableAudit);
for (PendingMessageCursor cursor : storePrefetches) { for (PendingMessageCursor cursor : storePrefetches) {
cursor.setEnableAudit(enableAudit); cursor.setEnableAudit(enableAudit);
} }
} }
public synchronized void setUseCache(boolean useCache) { public void setUseCache(boolean useCache) {
super.setUseCache(useCache); super.setUseCache(useCache);
for (PendingMessageCursor cursor : storePrefetches) { for (PendingMessageCursor cursor : storePrefetches) {
cursor.setUseCache(useCache); cursor.setUseCache(useCache);

View File

@ -179,25 +179,25 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor {
* @see org.apache.activemq.region.cursors.PendingMessageCursor * @see org.apache.activemq.region.cursors.PendingMessageCursor
* @return true if recovery required * @return true if recovery required
*/ */
public synchronized boolean isRecoveryRequired() { public boolean isRecoveryRequired() {
return false; return false;
} }
/** /**
* @return the nonPersistent Cursor * @return the nonPersistent Cursor
*/ */
public synchronized PendingMessageCursor getNonPersistent() { public PendingMessageCursor getNonPersistent() {
return this.nonPersistent; return this.nonPersistent;
} }
/** /**
* @param nonPersistent cursor to set * @param nonPersistent cursor to set
*/ */
public synchronized void setNonPersistent(PendingMessageCursor nonPersistent) { public void setNonPersistent(PendingMessageCursor nonPersistent) {
this.nonPersistent = nonPersistent; this.nonPersistent = nonPersistent;
} }
public synchronized void setMaxBatchSize(int maxBatchSize) { public void setMaxBatchSize(int maxBatchSize) {
persistent.setMaxBatchSize(maxBatchSize); persistent.setMaxBatchSize(maxBatchSize);
if (nonPersistent != null) { if (nonPersistent != null) {
nonPersistent.setMaxBatchSize(maxBatchSize); nonPersistent.setMaxBatchSize(maxBatchSize);
@ -206,7 +206,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor {
} }
public synchronized void setMaxProducersToAudit(int maxProducersToAudit) { public void setMaxProducersToAudit(int maxProducersToAudit) {
super.setMaxProducersToAudit(maxProducersToAudit); super.setMaxProducersToAudit(maxProducersToAudit);
if (persistent != null) { if (persistent != null) {
persistent.setMaxProducersToAudit(maxProducersToAudit); persistent.setMaxProducersToAudit(maxProducersToAudit);
@ -216,7 +216,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor {
} }
} }
public synchronized void setMaxAuditDepth(int maxAuditDepth) { public void setMaxAuditDepth(int maxAuditDepth) {
super.setMaxAuditDepth(maxAuditDepth); super.setMaxAuditDepth(maxAuditDepth);
if (persistent != null) { if (persistent != null) {
persistent.setMaxAuditDepth(maxAuditDepth); persistent.setMaxAuditDepth(maxAuditDepth);
@ -226,7 +226,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor {
} }
} }
public synchronized void setEnableAudit(boolean enableAudit) { public void setEnableAudit(boolean enableAudit) {
super.setEnableAudit(enableAudit); super.setEnableAudit(enableAudit);
if (persistent != null) { if (persistent != null) {
persistent.setEnableAudit(enableAudit); persistent.setEnableAudit(enableAudit);
@ -236,7 +236,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor {
} }
} }
public synchronized void setUseCache(boolean useCache) { public void setUseCache(boolean useCache) {
super.setUseCache(useCache); super.setUseCache(useCache);
if (persistent != null) { if (persistent != null) {
persistent.setUseCache(useCache); persistent.setUseCache(useCache);
@ -257,7 +257,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor {
} }
} }
public synchronized void setSystemUsage(SystemUsage usageManager) { public void setSystemUsage(SystemUsage usageManager) {
super.setSystemUsage(usageManager); super.setSystemUsage(usageManager);
if (persistent != null) { if (persistent != null) {
persistent.setSystemUsage(usageManager); persistent.setSystemUsage(usageManager);