activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [20/21] git commit: https://issues.apache.org/jira/browse/AMQ-4819
Date Thu, 13 Mar 2014 20:45:14 GMT
https://issues.apache.org/jira/browse/AMQ-4819

Slightly modified version of the patch since it was not against latest
code.  Trimmed down the changes by breaking out the logging checks into
a separate method.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/0ec3ffdf
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/0ec3ffdf
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/0ec3ffdf

Branch: refs/heads/activemq-5.9
Commit: 0ec3ffdf4fb97768d7b60ac9e924e6bf3389747b
Parents: 46d3a27
Author: Timothy Bish <tabish121@gmai.com>
Authored: Fri Dec 20 15:56:24 2013 -0500
Committer: Hadrian Zbarcea <hadrian@apache.org>
Committed: Thu Mar 13 16:33:50 2014 -0400

----------------------------------------------------------------------
 .../kahadb/scheduler/JobSchedulerStoreImpl.java   | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/0ec3ffdf/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
index f2a01f8..f467303 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java
@@ -30,8 +30,11 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.activemq.broker.LockableServiceSupport;
+import org.apache.activemq.broker.Locker;
 import org.apache.activemq.broker.scheduler.JobScheduler;
 import org.apache.activemq.broker.scheduler.JobSchedulerStore;
+import org.apache.activemq.store.SharedFileLocker;
 import org.apache.activemq.store.kahadb.disk.index.BTreeIndex;
 import org.apache.activemq.store.kahadb.disk.journal.Journal;
 import org.apache.activemq.store.kahadb.disk.journal.Location;
@@ -45,11 +48,10 @@ import org.apache.activemq.util.ByteSequence;
 import org.apache.activemq.util.IOHelper;
 import org.apache.activemq.util.LockFile;
 import org.apache.activemq.util.ServiceStopper;
-import org.apache.activemq.util.ServiceSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class JobSchedulerStoreImpl extends ServiceSupport implements JobSchedulerStore {
+public class JobSchedulerStoreImpl extends LockableServiceSupport implements JobSchedulerStore
{
     static final Logger LOG = LoggerFactory.getLogger(JobSchedulerStoreImpl.class);
     private static final int DATABASE_LOCKED_WAIT_DELAY = 10 * 1000;
 
@@ -60,7 +62,6 @@ public class JobSchedulerStoreImpl extends ServiceSupport implements JobSchedule
     PageFile pageFile;
     private Journal journal;
     protected AtomicLong journalSize = new AtomicLong(0);
-    private LockFile lockFile;
     private boolean failIfDatabaseIsLocked;
     private int journalMaxFileLength = Journal.DEFAULT_MAX_FILE_LENGTH;
     private int journalMaxWriteBatchSize = Journal.DEFAULT_MAX_WRITE_BATCH_SIZE;
@@ -405,4 +406,15 @@ public class JobSchedulerStoreImpl extends ServiceSupport implements
JobSchedule
     public String toString() {
         return "JobSchedulerStore:" + this.directory;
     }
+
+    @Override
+    public Locker createDefaultLocker() throws IOException {
+        SharedFileLocker locker = new SharedFileLocker();
+        locker.configure(this);
+        return locker;
+    }
+
+    @Override
+    public void init() throws Exception {
+    }
 }


Mime
View raw message