activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r560979 - in /activemq/trunk: activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
Date Mon, 30 Jul 2007 13:42:00 GMT
Author: chirino
Date: Mon Jul 30 06:41:59 2007
New Revision: 560979

URL: http://svn.apache.org/viewvc?view=rev&rev=560979
Log:
- Fix for the xmpp transport needed du to recently added stop() synchronization.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
    activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java?view=diff&rev=560979&r1=560978&r2=560979
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
Mon Jul 30 06:41:59 2007
@@ -137,14 +137,7 @@
         log.trace("TCP consumer thread starting");
         try {
 	        while (!isStopped()) {
-	            try {
-	                Object command = readCommand();
-	                doConsume(command);
-	            }
-	            catch (SocketTimeoutException e) {
-	            }
-	            catch (InterruptedIOException e) {
-	            }
+	            doRun();
 	        }
         } catch (IOException e) {
         	stoppedLatch.get().countDown();
@@ -153,6 +146,18 @@
         	stoppedLatch.get().countDown();
         }
     }
+
+
+	protected void doRun() throws IOException {
+		try {
+		    Object command = readCommand();
+		    doConsume(command);
+		}
+		catch (SocketTimeoutException e) {
+		}
+		catch (InterruptedIOException e) {
+		}
+	}
 
     protected Object readCommand() throws IOException {
         return wireFormat.unmarshal(dataIn);

Modified: activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java?view=diff&rev=560979&r1=560978&r2=560979
==============================================================================
--- activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
(original)
+++ activemq/trunk/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
Mon Jul 30 06:41:59 2007
@@ -144,9 +144,8 @@
     }
 
     @Override
-    public void run() {
+    public void doRun() throws IOException {
         log.debug("XMPP consumer thread starting");
-
         try {
             XMLInputFactory xif = XMLInputFactory.newInstance();
             xif.setXMLReporter(new XMLReporter() {
@@ -196,17 +195,8 @@
                 }
             }
         }
-        catch (XMLStreamException e) {
-            log.error("XMPP Reader thread caught: " + e, e);
-        }
-        catch (Exception e) {
-            log.error("XMPP Reader thread caught: " + e, e);
-        }
-        try {
-            stop();
-        }
         catch (Exception e) {
-            log.error("Failed to stop XMPP transport: " + e, e);
+        	throw IOExceptionSupport.create(e);
         }
     }
 



Mime
View raw message