[jboss-svn-commits] JBL Code SVN: r7497 - in labs/jbossesb/trunk/product/core/rosetta/src/org/jboss: internal/soa/esb/couriers soa/esb/couriers

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Nov 9 10:19:53 EST 2006


Author: kurt.stam at jboss.com
Date: 2006-11-09 10:19:51 -0500 (Thu, 09 Nov 2006)
New Revision: 7497

Modified:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/Courier.java
Log:
Adding Listener support.

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-11-09 15:14:15 UTC (rev 7496)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-11-09 15:19:51 UTC (rev 7497)
@@ -144,7 +144,7 @@
     				_logger.error("Unexpected thread interupt exception.", e);
     				break;
                 }
-             }
+            }
 		}
     }
     
@@ -199,4 +199,21 @@
     protected MessageProducer 	_messageProducer;
     protected long 				_sleepForRetries = 3000;   //  milliseconds
     protected List<KeyValuePair> _messageProperties;
+    
+    
+	public Message deliverAndWaitForPickup(Message message, long waitTime) throws CourierException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	public Message pickupNext(long waitTime) throws CourierException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	public void stopDurablePickup() throws CourierException {
+		// TODO Auto-generated method stub
+		
+	}
+    
+    
+	
 }

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/Courier.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/Courier.java	2006-11-09 15:14:15 UTC (rev 7496)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/Courier.java	2006-11-09 15:19:51 UTC (rev 7497)
@@ -23,18 +23,52 @@
 package org.jboss.soa.esb.couriers;
 
 import org.jboss.soa.esb.message.Message;
-
+/**
+ * 
+ * @author esteban
+ * @author kstam at redhat.com
+ *
+ */
 public interface Courier 
 {
-/**
- * try to deliver an ESB message
- * @param message Message - the message to deliver 
- * @return boolean - the result of the delivery
- * @throws CourierException - if problems were encountered
- */
-	public abstract boolean deliver(Message message) throws CourierException;
-/**
- * To be called when courier instance is going to be dropped
- */	
+	/**
+	 * try to deliver an ESB message
+	 * 
+	 * @param message Message - the message to deliver 
+	 * @return boolean - the result of the delivery
+	 * @throws CourierException - if problems were encountered
+	 */
+	public boolean deliver(Message message) throws CourierException;
+	/**
+	 * Waits for a certain amount of time (waitTime) at an address to pick up a message.
+	 * 
+	 * Question; should we allow for rescheduling (retry) a pickup?
+	 * 
+	 * @param message Message - the message to deliver.
+	 * @param waitTime        - Timeout for before giving up in millis.
+	 * @return                - the (reply)Message.
+	 * @throws CourierException
+	 */
+	public Message deliverAndWaitForPickup(Message message,long waitTime) throws CourierException;
+    /**
+     * Creates a durable pickup contract if one does not exist and tries to obtain the next message.
+     * 
+     * Question: is it cleaner to add a createDurablePickup() method?
+     * 
+      @param waitTime         - Pickup timeout for before giving up on this pickup. Time in millis.
+     * @return                - the message that was picked up.
+     * @throws CourierException
+     */
+	public Message pickupNext(long waitTime) throws CourierException;
+	/**
+	 * When you were engaged in a durable pickup, you need to notify the Courier you want to break
+	 * that contract. The courier will no longer go out for pickup.
+	 * 
+	 * @throws CourierException
+	 */
+	public void stopDurablePickup() throws CourierException;
+	/**
+	 * This will be replaced by stopPickup().
+	 */	
 	public abstract void 	cleanup();
 }




More information about the jboss-svn-commits mailing list