diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2014-11-08 12:56:12 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2014-11-08 12:56:12 +0000 |
| commit | acdb57af871cbfef3a768b2dd765246063129d5d (patch) | |
| tree | e1e498f39238251fc3878ca0308b4aed28244053 /qpid/java/broker-plugins | |
| parent | a943841f59639388b526ae51629d2c0f32311670 (diff) | |
| download | qpid-python-acdb57af871cbfef3a768b2dd765246063129d5d.tar.gz | |
QPID-6221 : [Java Broker] Detect low disk space conditions and enforce flow control
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1637558 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
5 files changed, 31 insertions, 2 deletions
diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyConfigurationStore.java b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyConfigurationStore.java index 85960cd25b..2764597bd0 100644 --- a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyConfigurationStore.java +++ b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyConfigurationStore.java @@ -221,6 +221,12 @@ public class DerbyConfigurationStore extends AbstractJDBCConfigurationStore } @Override + public File getStoreLocationAsFile() + { + return DerbyUtils.isInMemoryDatabase(getStoreLocation()) ? null : new File(getStoreLocation()); + } + + @Override protected Logger getLogger() { return DerbyConfigurationStore.this.getLogger(); diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java index 8ba5af9130..7d1191da2c 100644 --- a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java +++ b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java @@ -109,5 +109,9 @@ public class DerbyMessageStore extends AbstractDerbyMessageStore return ((FileBasedSettings)_parent).getStorePath(); } - + @Override + public File getStoreLocationAsFile() + { + return DerbyUtils.isInMemoryDatabase(getStoreLocation()) ? null : new File(getStoreLocation()); + } } diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyUtils.java b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyUtils.java index b3c449747b..df9c48d6f9 100644 --- a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyUtils.java +++ b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyUtils.java @@ -57,7 +57,7 @@ public class DerbyUtils public static String createConnectionUrl(final String name, final String databasePath) { // Derby wont use an existing directory, so we append parent name - if (MEMORY_STORE_LOCATION.equals(databasePath)) + if (isInMemoryDatabase(databasePath)) { return "jdbc:derby:" + MEMORY_STORE_LOCATION + "/" + name + ";create=true"; } @@ -79,6 +79,11 @@ public class DerbyUtils } + public static boolean isInMemoryDatabase(final String databasePath) + { + return MEMORY_STORE_LOCATION.equals(databasePath); + } + public static void shutdownDatabase(String connectionURL) throws SQLException { try diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java index 13d5c54ee4..3c3b1da880 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCConfigurationStore.java @@ -19,6 +19,7 @@ package org.apache.qpid.server.store.jdbc; +import java.io.File; import java.nio.charset.Charset; import java.security.PrivilegedAction; import java.sql.Blob; @@ -287,6 +288,12 @@ public class GenericJDBCConfigurationStore extends AbstractJDBCConfigurationStor } @Override + public File getStoreLocationAsFile() + { + return null; + } + + @Override protected Logger getLogger() { return GenericJDBCConfigurationStore.this.getLogger(); diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCMessageStore.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCMessageStore.java index 59e165acc2..a75ca4d685 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCMessageStore.java +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/GenericJDBCMessageStore.java @@ -21,6 +21,7 @@ package org.apache.qpid.server.store.jdbc; +import java.io.File; import java.security.PrivilegedAction; import java.sql.Blob; import java.sql.Connection; @@ -177,6 +178,12 @@ public class GenericJDBCMessageStore extends GenericAbstractJDBCMessageStore return _connectionURL; } + @Override + public File getStoreLocationAsFile() + { + return null; + } + protected String getPlainTextPassword(final JDBCSettings settings) { return Subject.doAs(SecurityManager.getSubjectWithAddedSystemRights(), new PrivilegedAction<String>() |
