added size() method to return amount of disk space the store occupies on disk

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@900420 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2010-01-18 15:17:44 +00:00
parent 27186c5ce2
commit 2e98d40065
1 changed files with 11 additions and 0 deletions

View File

@ -172,6 +172,17 @@ public class JobSchedulerStore extends ServiceSupport {
public void setDirectory(File directory) {
this.directory = directory;
}
public long size() {
if ( !isStarted() ) {
return 0;
}
try {
return journal.getDiskSize() + pageFile.getDiskSize();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public JobScheduler getJobScheduler(final String name) throws Exception {
JobSchedulerImpl result = this.schedulers.get(name);