activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r421936 - in /incubator/activemq/trunk/activemq-core/src: main/java/org/apache/activemq/broker/ main/java/org/apache/activemq/store/ main/java/org/apache/activemq/store/jdbc/ test/java/org/apache/activemq/usecases/
Date Fri, 14 Jul 2006 16:25:31 GMT
Author: jstrachan
Date: Fri Jul 14 09:25:29 2006
New Revision: 421936

URL: http://svn.apache.org/viewvc?rev=421936&view=rev
Log:
Added a workaround for Spring 2.0-rc1 for AMQ-825 where we avoid using File objects on the
default persistence adapter and use Strings instead. Its unfortunate (I tried patching xbean-spring
to get around this but I'm afraid it doesn't seem possible). So folks using Java to configure
the dataDirectory will need to change foo.setDataDirectory(file) to foo.setDataDirectoryFile(file)
 or switch to using a String

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/DefaultPersistenceAdapterFactory.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JDBCDurableSubscriptionTest.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JournalDurableSubscriptionTest.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=421936&r1=421935&r2=421936&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Fri Jul 14 09:25:29 2006
@@ -988,7 +988,7 @@
 
     protected DefaultPersistenceAdapterFactory createPersistenceFactory() {
         DefaultPersistenceAdapterFactory factory = new DefaultPersistenceAdapterFactory();
-        factory.setDataDirectory(getDataDirectory());
+        factory.setDataDirectoryFile(getDataDirectory());
         factory.setTaskRunnerFactory(getTaskRunnerFactory());
         return factory;
     }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/DefaultPersistenceAdapterFactory.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/DefaultPersistenceAdapterFactory.java?rev=421936&r1=421935&r2=421936&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/DefaultPersistenceAdapterFactory.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/DefaultPersistenceAdapterFactory.java
Fri Jul 14 09:25:29 2006
@@ -125,7 +125,7 @@
 
     public File getJournalArchiveDirectory() {
         if( journalArchiveDirectory == null && useQuickJournal ) {
-            journalArchiveDirectory = new File(getDataDirectory(), "journal");
+            journalArchiveDirectory = new File(getDataDirectoryFile(), "journal");
         }
         return journalArchiveDirectory;
     }
@@ -162,7 +162,7 @@
      * @throws IOException
      */
     protected void createJournal() throws IOException {
-        File journalDir = new File(getDataDirectory(), "journal").getCanonicalFile();
+        File journalDir = new File(getDataDirectoryFile(), "journal").getCanonicalFile();
         if( failIfJournalIsLocked ) {
             journal = new JournalImpl(journalDir, journalLogFiles, journalLogFileSize, getJournalArchiveDirectory());
         } else {

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java?rev=421936&r1=421935&r2=421936&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DataSourceSupport.java
Fri Jul 14 09:25:29 2006
@@ -31,7 +31,8 @@
  */
 public class DataSourceSupport {
 
-    private File dataDirectory;
+    private String dataDirectory = "activemq-data";
+    private File dataDirectoryFile;
     private DataSource dataSource;
 
     public DataSourceSupport() {
@@ -41,14 +42,22 @@
         this.dataSource = dataSource;
     }
 
-    public File getDataDirectory() {
-        if (dataDirectory == null) {
-            dataDirectory = new File("activemq-data");
+    public File getDataDirectoryFile() {
+        if (dataDirectoryFile == null) {
+            dataDirectoryFile = new File(getDataDirectory());
         }
+        return dataDirectoryFile;
+    }
+
+    public void setDataDirectoryFile(File dataDirectory) {
+        this.dataDirectoryFile = dataDirectory;
+    }
+
+    public String getDataDirectory() {
         return dataDirectory;
     }
 
-    public void setDataDirectory(File dataDirectory) {
+    public void setDataDirectory(String dataDirectory) {
         this.dataDirectory = dataDirectory;
     }
 
@@ -69,7 +78,7 @@
     protected DataSource createDataSource() throws IOException {
 
         // Setup the Derby datasource.
-        System.setProperty("derby.system.home", getDataDirectory().getCanonicalPath());
+        System.setProperty("derby.system.home", getDataDirectoryFile().getCanonicalPath());
         System.setProperty("derby.storage.fileSyncTransactionLog", "true");
         System.setProperty("derby.storage.pageCacheSize", "100");
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JDBCDurableSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JDBCDurableSubscriptionTest.java?rev=421936&r1=421935&r2=421936&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JDBCDurableSubscriptionTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JDBCDurableSubscriptionTest.java
Fri Jul 14 09:25:29 2006
@@ -30,7 +30,7 @@
     protected PersistenceAdapter createPersistenceAdapter() throws IOException {
         File dataDir = new File("target/test-data/durableJDBC");
         DefaultPersistenceAdapterFactory factory = new DefaultPersistenceAdapterFactory();
-        factory.setDataDirectory(dataDir);
+        factory.setDataDirectoryFile(dataDir);
         factory.setUseJournal(false);
         return factory.createPersistenceAdapter();
     }

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JournalDurableSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JournalDurableSubscriptionTest.java?rev=421936&r1=421935&r2=421936&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JournalDurableSubscriptionTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JournalDurableSubscriptionTest.java
Fri Jul 14 09:25:29 2006
@@ -30,7 +30,7 @@
     protected PersistenceAdapter createPersistenceAdapter() throws IOException {
         File dataDir = new File("target/test-data/durableJournal");
         DefaultPersistenceAdapterFactory factory = new DefaultPersistenceAdapterFactory();
-        factory.setDataDirectory(dataDir);
+        factory.setDataDirectoryFile(dataDir);
         factory.setUseJournal(true);
         factory.setJournalLogFileSize(1024*64); 
         return factory.createPersistenceAdapter();



Mime
View raw message