[jboss-svn-commits] JBL Code SVN: r6948 - in labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss: internal/soa/esb/couriers soa/esb soa/esb/couriers soa/esb/listeners

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Oct 20 08:08:26 EDT 2006


Author: estebanschifman
Date: 2006-10-20 08:08:19 -0400 (Fri, 20 Oct 2006)
New Revision: 6948

Added:
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/Courier.java
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierException.java
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierFactory.java
Removed:
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/Courier.java
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierException.java
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierFactory.java
Modified:
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/JmsGatewayListener.java
Log:
Only JmsCourier must be internal - Other classes in courier package

Deleted: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/Courier.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/Courier.java	2006-10-20 11:09:34 UTC (rev 6947)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/Courier.java	2006-10-20 12:08:19 UTC (rev 6948)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.internal.soa.esb.couriers;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.message.Message;
-
-public abstract class 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;
-
-	// no default constructor
-	private Courier() {}
-
-	/**
-	 * protected constructor 
-	 * @param epr
-	 */
-	// protected constructor
-	protected Courier (EPR epr)
-	{
-		_epr		= epr;
-	}
-	
-	/**
-	 * target EPR where to deliver ESB messages
-	 */
-	EPR				_epr;
-}

Deleted: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierException.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierException.java	2006-10-20 11:09:34 UTC (rev 6947)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierException.java	2006-10-20 12:08:19 UTC (rev 6948)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.internal.soa.esb.couriers;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Dispatch Exception.
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- */
-public class CourierException extends BaseException 
-{
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     */
-    public CourierException(String message) { super(message); }
-
-    /**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     * @param cause Exception cause.
-     */
-    public CourierException(String message, Throwable cause) { super(message, cause); }
-
-    /**
-     * Construct an exception instance. 
-     * @param cause Exception cause.
-     */
-    public CourierException(Throwable cause) { super(cause); }
-}

Deleted: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierFactory.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierFactory.java	2006-10-20 11:09:34 UTC (rev 6947)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierFactory.java	2006-10-20 12:08:19 UTC (rev 6948)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.internal.soa.esb.couriers;
-
-import java.net.URISyntaxException;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.helpers.*;
-
-public class CourierFactory 
-{
-	// private default constructor
-	private CourierFactory() {}
-
-	public static CourierFactory getInstance(Object obj)
-	{
-		return _instance;
-	}
-	
-	public static Courier getCourier(EPR epr) throws CourierException
-	{
-		try
-		{
-			String address = epr.getAddr().getAddress();
-			if (address.startsWith(JMSEpr.JMS_PROTOCOL))
-				return new JmsCourier(epr);
-		}
-		catch (URISyntaxException e) { throw new CourierException(e); }
-		throw new CourierException("Unknown protocol");
-	}
-	
-	private static final CourierFactory _instance = new CourierFactory();
-}

Modified: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-10-20 11:09:34 UTC (rev 6947)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-10-20 12:08:19 UTC (rev 6948)
@@ -29,29 +29,30 @@
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.helpers.JMSEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
 import org.jboss.soa.esb.helpers.AppServerContext;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.util.Util;
 import org.jboss.soa.esb.helpers.*;
 
-public class JmsCourier extends Courier 
+public class JmsCourier implements Courier 
 {
 	/**
 	 * disable default constructor
 	 */
-	private JmsCourier() { super(null); }
+	private JmsCourier() { }
 	/**
 	 * package protected constructor - Objects of Courier should only be instantiated by the Factory
 	 * @param epr
 	 */
-	JmsCourier(EPR epr) throws CourierException
+	public JmsCourier(EPR epr) throws CourierException
 	{
-		super(new JMSEpr(epr));
 		_sleepForRetries	= 3000;
 
 		try 
 		{
-			_messageProperties = Util.propertiesFromSelector(getEpr().getMessageSelector());
+			_messageProperties = Util.propertiesFromSelector(_epr.getMessageSelector());
 			createMessageProducer(); 
 		}
 		catch (Exception e) { throw new CourierException(e); }
@@ -59,19 +60,11 @@
     } //________________________________
 
 	/**
-	 * Cast _epr to JMSEpr
-	 * @return JMSEpr
-	 */
-	protected JMSEpr getEpr() { return (JMSEpr)_epr; }
-
-	@Override
-	/**
 	 * package the ESB message in a javax.jms.ObjectMessage, and send it
 	 * @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 
 	{
 		if (null==message)
@@ -129,24 +122,24 @@
     protected void createMessageProducer() throws Exception
     {
 
-        String sJndiType = getEpr().getJndiType();
+        String sJndiType = _epr.getJndiType();
         if (Util.isNullString(sJndiType))
         	sJndiType = "jboss";
-        String sJndiURL = getEpr().getJndiURL();
+        String sJndiURL = _epr.getJndiURL();
         if (Util.isNullString(sJndiURL))
         	sJndiURL = "localhost";
         Context oJndiCtx = AppServerContext.getServerContext(sJndiType,sJndiURL);
 
-        String sFactoryClass = getEpr().getConnectionFactory();
+        String sFactoryClass = _epr.getConnectionFactory();
         if (Util.isNullString(sFactoryClass))
         	sFactoryClass = "ConnectionFactory";
         
         Object tmp = oJndiCtx.lookup(sFactoryClass);
         
-        String sType = getEpr().getDestinationType();
+        String sType = _epr.getDestinationType();
         if (JMSEpr.QUEUE_TYPE.equals(sType))
         {
-            javax.jms.Queue queue = (javax.jms.Queue) oJndiCtx.lookup(getEpr().getDestinationName());
+            javax.jms.Queue queue = (javax.jms.Queue) oJndiCtx.lookup(_epr.getDestinationName());
             QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
             QueueConnection qConn = qcf.createQueueConnection();
             QueueSession qSess = qConn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
@@ -156,7 +149,7 @@
         }
         else if(JMSEpr.TOPIC_TYPE.equals(sType))
         {
-            Topic topic = (Topic) oJndiCtx.lookup(getEpr().getDestinationName());
+            Topic topic = (Topic) oJndiCtx.lookup(_epr.getDestinationName());
             TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
             TopicConnection tConn = tcf.createTopicConnection();
             TopicSession tSess = tConn.createTopicSession(false,TopicSession.AUTO_ACKNOWLEDGE);
@@ -168,7 +161,8 @@
         	throw new CourierException("Unknown destination type");
                 
     } //________________________________
-    
+
+    protected JMSEpr			_epr;
     protected Logger			_logger = Logger.getLogger(JmsCourier.class);
     protected String 			_messageSelector;
     protected Connection 		_jmsConnection;

Copied: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/Courier.java (from rev 6944, labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/Courier.java)
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/Courier.java	2006-10-20 10:53:36 UTC (rev 6944)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/Courier.java	2006-10-20 12:08:19 UTC (rev 6948)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.couriers;
+
+import org.jboss.soa.esb.message.Message;
+
+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;
+}

Copied: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierException.java (from rev 6944, labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierException.java)
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierException.java	2006-10-20 10:53:36 UTC (rev 6944)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierException.java	2006-10-20 12:08:19 UTC (rev 6948)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.couriers;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Dispatch Exception.
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ */
+public class CourierException extends BaseException 
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     */
+    public CourierException(String message) { super(message); }
+
+    /**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     * @param cause Exception cause.
+     */
+    public CourierException(String message, Throwable cause) { super(message, cause); }
+
+    /**
+     * Construct an exception instance. 
+     * @param cause Exception cause.
+     */
+    public CourierException(Throwable cause) { super(cause); }
+}

Copied: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierFactory.java (from rev 6944, labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierFactory.java)
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/CourierFactory.java	2006-10-20 10:53:36 UTC (rev 6944)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierFactory.java	2006-10-20 12:08:19 UTC (rev 6948)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.couriers;
+
+import java.net.URISyntaxException;
+
+import org.jboss.internal.soa.esb.couriers.JmsCourier;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.helpers.*;
+
+public class CourierFactory 
+{
+	// private default constructor
+	private CourierFactory() {}
+
+	public static CourierFactory getInstance(Object obj)
+	{
+		return _instance;
+	}
+	
+	public static Courier getCourier(EPR epr) throws CourierException
+	{
+		try
+		{
+			String address = epr.getAddr().getAddress();
+			if (address.startsWith(JMSEpr.JMS_PROTOCOL))
+				return new JmsCourier(epr);
+		}
+		catch (URISyntaxException e) { throw new CourierException(e); }
+		throw new CourierException("Unknown protocol");
+	}
+	
+	private static final CourierFactory _instance = new CourierFactory();
+}

Modified: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/JmsGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/JmsGatewayListener.java	2006-10-20 11:09:34 UTC (rev 6947)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/JmsGatewayListener.java	2006-10-20 12:08:19 UTC (rev 6948)
@@ -40,6 +40,9 @@
 import org.jboss.internal.soa.esb.couriers.*;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.helpers.JMSEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
 import org.jboss.soa.esb.helpers.AppServerContext;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.message.Message;




More information about the jboss-svn-commits mailing list