activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r514364 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/store/amq/ test/java/org/apache/activemq/broker/region/cursors/ test/java/org/apache/activemq/perf/
Date Sun, 04 Mar 2007 06:46:53 GMT
Author: rajdavies
Date: Sat Mar  3 22:46:52 2007
New Revision: 514364

URL: http://svn.apache.org/viewvc?view=rev&rev=514364
Log:
Pass in broker name to the AMQPersistenceAdapter

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreCursorDurableTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreQueueStoreTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java?view=diff&rev=514364&r1=514363&r2=514364
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java
Sat Mar  3 22:46:52 2007
@@ -107,14 +107,25 @@
 	private Runnable periodicCleanupTask;
 	private boolean deleteAllMessages;
     private boolean syncOnWrite;
-	private File directory = new File(IOHelper.getDefaultDataDirectory() + "/amq");
+    private String brokerName;
+	private File directory;
+   
 
+     public AMQPersistenceAdapter() {
+            this("localhost");
+        }
+    public AMQPersistenceAdapter(String brokerName) {
+        this.brokerName = brokerName;
+        this.directory=new File(IOHelper.getDefaultDataDirectory(),brokerName + "-amqstore");
+    }
 
     
     public synchronized void start() throws Exception {
         if( !started.compareAndSet(false, true) )
             return;
-        this.usageManager.addUsageListener(this);
+        if (this.usageManager!=null) {
+            this.usageManager.addUsageListener(this);
+        }
 
         if( asyncDataManager == null ) {
         	asyncDataManager = createAsyncDataManager();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreCursorDurableTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreCursorDurableTest.java?view=diff&rev=514364&r1=514363&r2=514364
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreCursorDurableTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreCursorDurableTest.java
Sat Mar  3 22:46:52 2007
@@ -31,7 +31,7 @@
     
 
     protected void configureBroker(BrokerService answer) throws Exception{
-        AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
+        AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter("localhost");
         answer.setPersistenceAdapter(adaptor);
         answer.setDeleteAllMessagesOnStartup(true);
         answer.addConnector(bindAddress);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreQueueStoreTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreQueueStoreTest.java?view=diff&rev=514364&r1=514363&r2=514364
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreQueueStoreTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/region/cursors/AMQStoreQueueStoreTest.java
Sat Mar  3 22:46:52 2007
@@ -35,7 +35,7 @@
     
 
     protected void configureBroker(BrokerService answer) throws Exception{
-        PersistenceAdapter adaptor = new AMQPersistenceAdapter();
+        PersistenceAdapter adaptor = new AMQPersistenceAdapter("localhost");
         answer.setPersistenceAdapter(adaptor);
         PolicyEntry policy = new PolicyEntry();
         policy.setPendingQueuePolicy(new StorePendingQueueMessageStoragePolicy());

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java?view=diff&rev=514364&r1=514363&r2=514364
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java
Sat Mar  3 22:46:52 2007
@@ -17,7 +17,6 @@
 import java.io.File;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.store.amq.AMQPersistenceAdapter;
-import org.apache.activemq.store.quick.QuickPersistenceAdapter;
 
 /**
  * @version $Revision: 1.3 $
@@ -27,10 +26,10 @@
    
     protected void configureBroker(BrokerService answer) throws Exception{
         File dataFileDir=new File("target/test-amq-data/perfTest/amqdb");
-        AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
+        AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter("localhost");
         adaptor.setDirectory(dataFileDir);
         answer.setPersistenceAdapter(adaptor);
-        answer.addConnector(bindAddress);
         answer.setDeleteAllMessagesOnStartup(true);
+        answer.addConnector(bindAddress);
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java?view=diff&rev=514364&r1=514363&r2=514364
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreQueueTest.java
Sat Mar  3 22:46:52 2007
@@ -31,7 +31,7 @@
         
     	File dataFileDir = new File("target/test-amq-data/perfTest/amq");
     	
-        AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter();
+        AMQPersistenceAdapter adaptor = new AMQPersistenceAdapter("localhost");
         adaptor.setDirectory(dataFileDir);
         
         answer.setPersistenceAdapter(adaptor);



Mime
View raw message