[jboss-svn-commits] JBL Code SVN: r23386 - labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/couriers.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Oct 9 04:35:04 EDT 2008


Author: kevin.conner at jboss.com
Date: 2008-10-09 04:35:04 -0400 (Thu, 09 Oct 2008)
New Revision: 23386

Modified:
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
Log:
Throw exceptions when disabled: JBESB-2102

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java	2008-10-09 08:32:58 UTC (rev 23385)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/couriers/InVMCourier.java	2008-10-09 08:35:04 UTC (rev 23386)
@@ -105,10 +105,8 @@
      *                          if problems were encountered
      */
     
-    public boolean deliver(Message message) {
-        if (!isCourierActive()) {
-            return false;
-        }
+    public boolean deliver(Message message) throws CourierException {
+        isCourierActive() ;
 
         if (message == null) {
             return false;
@@ -241,10 +239,8 @@
     
     // see associated test
     
-    public Message pickup(long millis) {
-        if (!isCourierActive()) {
-            return null;
-        }
+    public Message pickup(long millis) throws CourierException {
+        isCourierActive() ;
 
         Message message = null;
 
@@ -307,12 +303,10 @@
     public void cleanup() {
     }
 
-    private boolean isCourierActive() {
+    private void isCourierActive() throws CourierException {
         if (!isActive) {
-            logger.debug("InVMCourier for EPR '" + epr.getAddr().getAddress() + "' is not active.  Cannot pickup/deliver on this courier.", new Exception());
-            return false;
+            throw new CourierException("InVMCourier for EPR '" + epr.getAddr().getAddress() + "' is not active.  Cannot pickup/deliver on this courier.");
         }
-        return true;
     }
 
     public void setActive(boolean active) {




More information about the jboss-svn-commits mailing list