diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-02-27 14:58:24 -0600 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-03-12 09:39:31 -0500 |
commit | 34f141c1144dac37248cf404835248413218627e (patch) | |
tree | 19b5b599f1eed47d020ec542c19bafdd84b1d57f /pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java | |
parent | 87585b101172461d2ad175515154a3f4dbdcd089 (diff) | |
download | pki-34f141c1144dac37248cf404835248413218627e.tar.gz pki-34f141c1144dac37248cf404835248413218627e.tar.xz pki-34f141c1144dac37248cf404835248413218627e.zip |
Refactored JobsScheduler.
The JobsScheduler has been modified to stop all jobs on shutdown.
This is done by setting a flag in each job instead of stopping the
job thread abruptly. Long running jobs should check this flag
periodically and then exit gracefully. None of the existing jobs
need to do this since they do not run very long.
Other threads that run background services have been converted into
daemons such that they will terminate automatically when the JVM
exits.
Ticket #73
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java b/pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java index 903f83691..2289d7255 100644 --- a/pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java +++ b/pki/base/common/src/com/netscape/cms/jobs/PublishCertsJob.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cms.jobs; -import java.security.cert.X509Certificate; import java.text.DateFormat; import java.util.Date; import java.util.Enumeration; @@ -135,7 +134,7 @@ public class PublishCertsJob extends AJobBase } mReqQ = mCa.getRequestQueue(); - mRepository = (ICertificateRepository) mCa.getCertificateRepository(); + mRepository = mCa.getCertificateRepository(); mPublisherProcessor = mCa.getPublisherProcessor(); // read from the configuration file @@ -299,7 +298,7 @@ public class PublishCertsJob extends AJobBase try { if ((mPublisherProcessor != null) && mPublisherProcessor.enabled()) { - mPublisherProcessor.publishCert((X509Certificate) cert, req); + mPublisherProcessor.publishCert(cert, req); if (mSummary == true) buildItemParams(IEmailFormProcessor.TOKEN_STATUS, STATUS_SUCCESS); @@ -322,7 +321,7 @@ public class PublishCertsJob extends AJobBase try { if ((mPublisherProcessor != null) && mPublisherProcessor.enabled()) { - mPublisherProcessor.publishCert((X509Certificate) cert, null); + mPublisherProcessor.publishCert(cert, null); if (mSummary == true) buildItemParams(IEmailFormProcessor.TOKEN_STATUS, @@ -396,6 +395,6 @@ public class PublishCertsJob extends AJobBase * @return String array of configuration parameter names. */ public String[] getConfigParams() { - return (mConfigParams); + return mConfigParams; } } |