activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-4819
Date Fri, 20 Dec 2013 20:56:32 GMT
Updated Branches:
  refs/heads/trunk 14d24cca3 -> 44b25cb7a


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/44b25cb7
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/44b25cb7
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/44b25cb7

Branch: refs/heads/trunk
Commit: 44b25cb7a1385ba0e019db97e9fe9899737b2d0f
Parents: 14d24cc
Author: Timothy Bish <tabish121@gmai.com>
Authored: Fri Dec 20 15:56:24 2013 -0500
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Fri Dec 20 15:56:24 2013 -0500

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/44b25cb7/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