From 2e98d400650eccbe87a4678c4127c0ee3a54b446 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Mon, 18 Jan 2010 15:17:44 +0000 Subject: [PATCH] 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 --- .../activemq/broker/scheduler/JobSchedulerStore.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java b/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java index 99eeaa2acd..3dfe1f0f26 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/scheduler/JobSchedulerStore.java @@ -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);