activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: fix for: https://issues.apache.org/jira/browse/AMQ-4059
Date Fri, 20 Sep 2013 15:59:12 GMT
Updated Branches:
  refs/heads/trunk efaa351db -> 062adbbe7


fix for: https://issues.apache.org/jira/browse/AMQ-4059

Removes deps on camel from activemq-web, code not needed for the
examples.

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/062adbbe
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/062adbbe
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/062adbbe

Branch: refs/heads/trunk
Commit: 062adbbe7278f63d3b4102e063e3bfea213754df
Parents: efaa351
Author: Timothy Bish <tabish121@gmai.com>
Authored: Fri Sep 20 11:59:05 2013 -0400
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Fri Sep 20 11:59:05 2013 -0400

----------------------------------------------------------------------
 activemq-web/pom.xml                            |  6 ++--
 .../org/apache/activemq/web/MessageServlet.java | 27 +++-------------
 .../java/org/apache/activemq/web/WebClient.java | 34 --------------------
 3 files changed, 8 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/062adbbe/activemq-web/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-web/pom.xml b/activemq-web/pom.xml
index bf7f610..58510cd 100755
--- a/activemq-web/pom.xml
+++ b/activemq-web/pom.xml
@@ -32,7 +32,6 @@
   <properties>
     <activemq.osgi.import.pkg>
       org.apache.activemq*;resolution:=optional,
-      org.apache.camel*;resolution:=optional,
       org.eclipse.jetty*;resolution:=optional,
       org.springframework*;resolution:=optional,
       com.thoughtworks.xstream*;resolution:=optional,
@@ -46,9 +45,10 @@
 
   <dependencies>
     <!-- activemq -->
+
     <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>activemq-camel</artifactId>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>activemq-all</artifactId>
     </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/activemq/blob/062adbbe/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
----------------------------------------------------------------------
diff --git a/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java b/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
index 06948f9..f099aeb 100644
--- a/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
+++ b/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
@@ -129,28 +129,11 @@ public class MessageServlet extends MessageServletSupport {
             boolean sync = isSync(request);
             TextMessage message = client.getSession().createTextMessage(text);
 
-            if (sync) {
-               String point = "activemq:"
-                   + ((ActiveMQDestination)destination).getPhysicalName().replace("//", "")
-                   + "?requestTimeout=" + requestTimeout;
-               try {
-                   String body = (String)client.getProducerTemplate().requestBody(point,
text);
-                   ActiveMQTextMessage answer = new ActiveMQTextMessage();
-                   answer.setText(body);
-
-                   writeMessageResponse(response.getWriter(), answer);
-               } catch (Exception e) {
-                   IOException ex = new IOException();
-                   ex.initCause(e);
-                   throw ex;
-               }
-            } else {
-                appendParametersToMessage(request, message);
-                boolean persistent = isSendPersistent(request);
-                int priority = getSendPriority(request);
-                long timeToLive = getSendTimeToLive(request);
-                client.send(destination, message, persistent, priority, timeToLive);
-            }
+            appendParametersToMessage(request, message);
+            boolean persistent = isSendPersistent(request);
+            int priority = getSendPriority(request);
+            long timeToLive = getSendTimeToLive(request);
+            client.send(destination, message, persistent, priority, timeToLive);
 
             // lets return a unique URI for reliable messaging
             response.setHeader("messageID", message.getJMSMessageID());

http://git-wip-us.apache.org/repos/asf/activemq/blob/062adbbe/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
----------------------------------------------------------------------
diff --git a/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java b/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
index 4b25ca3..66ca782 100644
--- a/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
+++ b/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
@@ -49,12 +49,6 @@ import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.MessageAvailableConsumer;
 import org.apache.activemq.broker.BrokerRegistry;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.camel.component.ActiveMQComponent;
-import org.apache.activemq.camel.component.ActiveMQConfiguration;
-import org.apache.activemq.pool.PooledConnectionFactory;
-import org.apache.camel.CamelContext;
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.impl.DefaultCamelContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -88,9 +82,6 @@ public class WebClient implements HttpSessionActivationListener, HttpSessionBind
 
     private final Semaphore semaphore = new Semaphore(1);
 
-    private CamelContext camelContext;
-    private ProducerTemplate producerTemplate;
-
     private String username;
     private String password;
 
@@ -185,16 +176,12 @@ public class WebClient implements HttpSessionActivationListener, HttpSessionBind
             if (connection != null) {
                 connection.close();
             }
-            if (producerTemplate != null) {
-            	producerTemplate.stop();
-            }
         } catch (Exception e) {
             LOG.debug("caught exception closing consumer", e);
         } finally {
             producer = null;
             session = null;
             connection = null;
-            producerTemplate = null;
             if (consumers != null) {
                 consumers.clear();
             }
@@ -314,27 +301,6 @@ public class WebClient implements HttpSessionActivationListener, HttpSessionBind
             servletContext.setAttribute(CONNECTION_FACTORY_ATTRIBUTE, factory);
         }
     }
-    
-    public synchronized CamelContext getCamelContext() {
-    	if (camelContext == null) {
-    		LOG.debug("Creating camel context");
-    		camelContext = new DefaultCamelContext();
-    		ActiveMQConfiguration conf = new ActiveMQConfiguration();
-    		conf.setConnectionFactory(new PooledConnectionFactory((ActiveMQConnectionFactory)factory));
-    		ActiveMQComponent component = new ActiveMQComponent(conf);
-    		camelContext.addComponent("activemq", component);
-    	}
-    	return camelContext;
-    }
-    
-    public synchronized ProducerTemplate getProducerTemplate() throws Exception {
-    	if (producerTemplate == null) {
-    		LOG.debug("Creating producer template");
-    		producerTemplate = getCamelContext().createProducerTemplate();
-    		producerTemplate.start();
-    	}
-    	return producerTemplate;
-    }
 
     public synchronized MessageProducer getProducer() throws JMSException {
         if (producer == null) {


Mime
View raw message