Author: david.lloyd(a)jboss.com
Date: 2010-03-25 19:25:26 -0400 (Thu, 25 Mar 2010)
New Revision: 5837
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/RemoteConnectionHandler.java
Log:
JBREM-1214 - fix a bug where exceptions thrown during message processing do not close the
connection correctly
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/RemoteConnectionHandler.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/RemoteConnectionHandler.java 2010-03-25
03:40:22 UTC (rev 5836)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/RemoteConnectionHandler.java 2010-03-25
23:25:26 UTC (rev 5837)
@@ -31,6 +31,7 @@
import org.jboss.marshalling.Marshalling;
import org.jboss.marshalling.MarshallingConfiguration;
import org.jboss.marshalling.util.IntKeyMap;
+import org.jboss.remoting3.CloseHandler;
import org.jboss.remoting3.IndeterminateOutcomeException;
import org.jboss.remoting3.ServiceOpenException;
import org.jboss.remoting3.spi.AbstractHandleableCloseable;
@@ -82,6 +83,11 @@
config.setStreamHeader(Marshalling.nullStreamHeader());
// fixed for now (v0)
config.setVersion(2);
+ remoteConnection.addCloseHandler(new CloseHandler<RemoteConnection>() {
+ public void handleClose(final RemoteConnection closed) {
+ IoUtils.safeClose(RemoteConnectionHandler.this);
+ }
+ });
marshallingConfiguration = config;
}