Author: norman
Date: Sun Jan  9 20:54:38 2011
New Revision: 1057028

URL: http://svn.apache.org/viewvc?rev=1057028&view=rev
Log:
Throw exception in MBean

Modified:
    
james/server/trunk/queue-library/src/main/java/org/apache/james/queue/library/MailQueueManagement.java

Modified: 
james/server/trunk/queue-library/src/main/java/org/apache/james/queue/library/MailQueueManagement.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/queue-library/src/main/java/org/apache/james/queue/library/MailQueueManagement.java?rev=1057028&r1=1057027&r2=1057028&view=diff
==============================================================================
--- 
james/server/trunk/queue-library/src/main/java/org/apache/james/queue/library/MailQueueManagement.java
 (original)
+++ 
james/server/trunk/queue-library/src/main/java/org/apache/james/queue/library/MailQueueManagement.java
 Sun Jan  9 20:54:38 2011
@@ -57,11 +57,11 @@ public class MailQueueManagement extends
      * (non-Javadoc)
      * @see org.apache.james.queue.api.MailQueueManagementMBean#clear()
      */
-    public long clear() {
+    public long clear() throws Exception{
         try {
             return queue.clear();
         } catch (MailQueueException e) {
-            return -1;
+            throw new Exception(e.getMessage());
         }
     }
 
@@ -69,11 +69,11 @@ public class MailQueueManagement extends
      * (non-Javadoc)
      * @see org.apache.james.queue.api.MailQueueManagementMBean#flush()
      */
-    public long flush() {
+    public long flush() throws Exception {
         try {
             return queue.flush();
         } catch (MailQueueException e) {
-            return -1;
+            throw new Exception(e.getMessage());
         }
     }
 
@@ -81,11 +81,11 @@ public class MailQueueManagement extends
      * (non-Javadoc)
      * @see org.apache.james.queue.api.MailQueueManagementMBean#getSize()
      */
-    public long getSize() {
+    public long getSize() throws Exception {
         try {
             return queue.getSize();
         } catch (MailQueueException e) {
-            return -1;
+            throw new Exception(e.getMessage());
         }
     }
 
@@ -93,11 +93,11 @@ public class MailQueueManagement extends
      * (non-Javadoc)
      * @see 
org.apache.james.queue.api.MailQueueManagementMBean#removeWithName(java.lang.String)
      */
-    public long removeWithName(String name) {
+    public long removeWithName(String name) throws Exception {
         try {
             return queue.remove(Type.Name, name);
         } catch (MailQueueException e) {
-            return -1;
+            throw new Exception(e.getMessage());
         }
     }
 
@@ -105,11 +105,11 @@ public class MailQueueManagement extends
      * (non-Javadoc)
      * @see 
org.apache.james.queue.api.MailQueueManagementMBean#removeWithRecipient(java.lang.String)
      */
-    public long removeWithRecipient(String address) {
+    public long removeWithRecipient(String address) throws Exception {
         try {
             return queue.remove(Type.Recipient, address);
         } catch (MailQueueException e) {
-            return -1;
+            throw new Exception(e.getMessage());
         }
     }
 
@@ -117,11 +117,11 @@ public class MailQueueManagement extends
      * (non-Javadoc)
      * @see 
org.apache.james.queue.api.MailQueueManagementMBean#removeWithSender(java.lang.String)
      */
-    public long removeWithSender(String address) {
+    public long removeWithSender(String address) throws Exception {
         try {
             return queue.remove(Type.Sender, address);
         } catch (MailQueueException e) {
-            return -1;
+            throw new Exception(e.getMessage());
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to