This closes #797

This commit is contained in:
Clebert Suconic 2016-09-26 13:33:23 -04:00
commit 061ca9ce50
3 changed files with 72 additions and 0 deletions

View File

@ -403,6 +403,24 @@ public interface ActiveMQServerControl {
@Attribute(desc = "whether the initial replication synchronization process with the backup server is complete")
boolean isReplicaSync();
/**
* Returns how often the server checks for disk space usage.
*/
@Attribute(desc = "how often to check for disk space usage, in milliseconds")
int getDiskScanPeriod();
/**
* Returns the disk use max limit.
*/
@Attribute(desc = "maximum limit for disk use, in percentage")
int getMaxDiskUsage();
/**
* Returns the global max bytes limit for in-memory messages.
*/
@Attribute(desc = "global maximum limit for in-memory messages, in bytes")
long getGlobalMaxSize();
// Operations ----------------------------------------------------
/**

View File

@ -545,6 +545,45 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
}
}
@Override
public int getDiskScanPeriod() {
checkStarted();
clearIO();
try {
return configuration.getDiskScanPeriod();
}
finally {
blockOnIO();
}
}
@Override
public int getMaxDiskUsage() {
checkStarted();
clearIO();
try {
return configuration.getMaxDiskUsage();
}
finally {
blockOnIO();
}
}
@Override
public long getGlobalMaxSize() {
checkStarted();
clearIO();
try {
return configuration.getGlobalMaxSize();
}
finally {
blockOnIO();
}
}
@Override
public void deployQueue(final String address, final String name, final String filterString) throws Exception {
checkStarted();

View File

@ -509,6 +509,21 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
return (Boolean) proxy.retrieveAttributeValue("PersistenceEnabled");
}
@Override
public int getDiskScanPeriod() {
return (Integer) proxy.retrieveAttributeValue("DiskScanPeriod", Integer.class);
}
@Override
public int getMaxDiskUsage() {
return (Integer) proxy.retrieveAttributeValue("MaxDiskUsage", Integer.class);
}
@Override
public long getGlobalMaxSize() {
return (Long) proxy.retrieveAttributeValue("GlobalMaxSize", Long.class);
}
@Override
public void addSecuritySettings(String addressMatch,
String sendRoles,