diff options
Diffstat (limited to 'base/common/src/com')
11 files changed, 27 insertions, 18 deletions
diff --git a/base/common/src/com/netscape/certsrv/request/ARequestNotifier.java b/base/common/src/com/netscape/certsrv/request/ARequestNotifier.java index f8f7588a7..4a6e3260b 100644 --- a/base/common/src/com/netscape/certsrv/request/ARequestNotifier.java +++ b/base/common/src/com/netscape/certsrv/request/ARequestNotifier.java @@ -459,7 +459,9 @@ public class ARequestNotifier implements IRequestNotifier { CMS.debug("recoverPublishingQueue extended buffer to " + mRequests.size() + "(" + mMaxRequests + ")" + " requests by adding request " + id); if (morePublishingThreads()) { - mSearchForRequests = true; + synchronized (this) { + mSearchForRequests = true; + } try { Thread notifierThread = new Thread(new RunListeners(this)); if (notifierThread != null) { diff --git a/base/common/src/com/netscape/cmscore/authentication/VerifiedCerts.java b/base/common/src/com/netscape/cmscore/authentication/VerifiedCerts.java index 01c455464..ccefe5b21 100644 --- a/base/common/src/com/netscape/cmscore/authentication/VerifiedCerts.java +++ b/base/common/src/com/netscape/cmscore/authentication/VerifiedCerts.java @@ -53,7 +53,7 @@ public class VerifiedCerts { mUnknownStateInterval = unknownStateInterval; } - public void update(X509CertImpl cert, int status) { + public synchronized void update(X509CertImpl cert, int status) { if (cert != null) { byte[] certEncoded = null; @@ -90,7 +90,7 @@ public class VerifiedCerts { } } - public int check(X509CertImpl cert) { + public synchronized int check(X509CertImpl cert) { int status = VerifiedCert.UNKNOWN; if (mLast != mNext && mInterval > 0) { // if not empty and diff --git a/base/common/src/com/netscape/cmscore/cert/CrossCertPairSubsystem.java b/base/common/src/com/netscape/cmscore/cert/CrossCertPairSubsystem.java index dd7918bd5..4db850d2e 100644 --- a/base/common/src/com/netscape/cmscore/cert/CrossCertPairSubsystem.java +++ b/base/common/src/com/netscape/cmscore/cert/CrossCertPairSubsystem.java @@ -101,8 +101,10 @@ public class CrossCertPairSubsystem implements ICrossCertPairSubsystem { try { mConfig = config; mLogger = CMS.getLogger(); - mCa = (ICertificateAuthority) CMS.getSubsystem("ca"); - mPublisherProcessor = mCa.getPublisherProcessor(); + synchronized (this) { + mCa = (ICertificateAuthority) CMS.getSubsystem("ca"); + mPublisherProcessor = mCa.getPublisherProcessor(); + } // initialize LDAP connection factory IConfigStore ldapConfig = mConfig.getSubStore(PROP_LDAP); diff --git a/base/common/src/com/netscape/cmscore/cert/OidLoaderSubsystem.java b/base/common/src/com/netscape/cmscore/cert/OidLoaderSubsystem.java index 0feebb7ec..95bbd98e7 100644 --- a/base/common/src/com/netscape/cmscore/cert/OidLoaderSubsystem.java +++ b/base/common/src/com/netscape/cmscore/cert/OidLoaderSubsystem.java @@ -182,7 +182,7 @@ public class OidLoaderSubsystem implements ISubsystem { * * @return configuration store of this subsystem */ - public IConfigStore getConfigStore() { + public synchronized IConfigStore getConfigStore() { return mConfig; } diff --git a/base/common/src/com/netscape/cmscore/cert/X500NameSubsystem.java b/base/common/src/com/netscape/cmscore/cert/X500NameSubsystem.java index 96dc64e57..7accf2b4f 100644 --- a/base/common/src/com/netscape/cmscore/cert/X500NameSubsystem.java +++ b/base/common/src/com/netscape/cmscore/cert/X500NameSubsystem.java @@ -277,7 +277,7 @@ public class X500NameSubsystem implements ISubsystem { protected ILogger mLogger = null; - protected void log(int level, String msg) { + protected synchronized void log(int level, String msg) { mLogger.log(ILogger.EV_SYSTEM, ILogger.S_ADMIN, level, msg); } diff --git a/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java b/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java index 0872d1f40..14e06aeb3 100644 --- a/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java +++ b/base/common/src/com/netscape/cmscore/dbs/CertificateRepository.java @@ -226,11 +226,13 @@ public class CertificateRepository extends Repository * 0 - disable * >0 - enable */ - public void setCertStatusUpdateInterval(IRepository requestRepository, int interval, boolean listenToCloneModifications) { + public void setCertStatusUpdateInterval(IRepository requestRepository, int interval, + boolean listenToCloneModifications) { CMS.debug("In setCertStatusUpdateInterval " + interval); - - this.requestRepository = requestRepository; + synchronized (this) { + this.requestRepository = requestRepository; + } // stop running tasks if (certStatusUpdateTask != null) { diff --git a/base/common/src/com/netscape/cmscore/dbs/DBVirtualList.java b/base/common/src/com/netscape/cmscore/dbs/DBVirtualList.java index 854a92e15..51a9230ac 100644 --- a/base/common/src/com/netscape/cmscore/dbs/DBVirtualList.java +++ b/base/common/src/com/netscape/cmscore/dbs/DBVirtualList.java @@ -308,9 +308,11 @@ public class DBVirtualList<E> implements IDBVirtualList<E> { if (sortKeys == null) throw new EBaseException("sort keys cannot be null"); try { - mKeys = new LDAPSortKey[sortKeys.length]; - String la[] = mRegistry.getLDAPAttributes(sortKeys); + String la[] = null; + synchronized (this) { + la = mRegistry.getLDAPAttributes(sortKeys); + } for (int j = 0; j < sortKeys.length; j++) { mKeys[j] = new LDAPSortKey(la[j]); diff --git a/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java b/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java index 0fbff688a..fb3b9b24a 100644 --- a/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java +++ b/base/common/src/com/netscape/cmscore/dbs/KeyRepository.java @@ -154,8 +154,9 @@ public class KeyRepository extends Repository implements IKeyRepository { public void setKeyStatusUpdateInterval(IRepository requestRepo, int interval) { CMS.debug("In setKeyStatusUpdateInterval " + interval); - - this.requestRepository = requestRepo; + synchronized (this) { + this.requestRepository = requestRepo; + } // stop running task if (mKeyStatusUpdateTask != null) { diff --git a/base/common/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java b/base/common/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java index c3e84f136..5be645b56 100644 --- a/base/common/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java +++ b/base/common/src/com/netscape/cmscore/ldapconn/LdapBoundConnFactory.java @@ -82,7 +82,7 @@ public class LdapBoundConnFactory implements ILdapBoundConnFactory { return mTotal; } - public int freeConn() { + public synchronized int freeConn() { return mNumConns; } diff --git a/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java b/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java index d717d9732..7b3eac274 100644 --- a/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java +++ b/base/common/src/com/netscape/cmscore/policy/GenericPolicyProcessor.java @@ -129,7 +129,7 @@ public class GenericPolicyProcessor implements IPolicyProcessor { * * @return configuration store */ - public IConfigStore getConfigStore() { + public synchronized IConfigStore getConfigStore() { return mConfig; } diff --git a/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java b/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java index 5822542a3..40499577e 100644 --- a/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java +++ b/base/common/src/com/netscape/cmscore/util/ProfileSubsystem.java @@ -144,7 +144,7 @@ public class ProfileSubsystem extends Frame implements ISubsystem, Runnable { return null; } - public void updateGeneralPanel() { + public synchronized void updateGeneralPanel() { Runtime.getRuntime().gc(); String text = "JDK VM Information " + "\n" + @@ -161,7 +161,7 @@ public class ProfileSubsystem extends Frame implements ISubsystem, Runnable { mTextArea.setText(text); } - public void updateThreadPanel() { + public synchronized void updateThreadPanel() { Thread currentThread = Thread.currentThread(); Vector<Vector<String>> data = new Vector<Vector<String>>(); Thread threads[] = new Thread[100]; |