Author: david.lloyd(a)jboss.com
Date: 2010-02-27 16:47:33 -0500 (Sat, 27 Feb 2010)
New Revision: 5763
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundReplyExceptionTask.java
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundReplyTask.java
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundRequestTask.java
Log:
More verbose trace logging
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundReplyExceptionTask.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundReplyExceptionTask.java 2010-02-27
20:42:22 UTC (rev 5762)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundReplyExceptionTask.java 2010-02-27
21:47:33 UTC (rev 5763)
@@ -61,6 +61,9 @@
} catch (Exception e) {
SpiUtils.safeHandleException(replyHandler, new
RemoteRequestException(e));
return;
+ } catch (Error e) {
+ SpiUtils.safeHandleException(replyHandler,new
RemoteReplyException("Failed to unmarshall exception reply", e));
+ throw e;
}
RemoteReplyException rre;
try {
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundReplyTask.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundReplyTask.java 2010-02-27
20:42:22 UTC (rev 5762)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundReplyTask.java 2010-02-27
21:47:33 UTC (rev 5763)
@@ -24,10 +24,10 @@
import java.io.IOException;
import org.jboss.marshalling.Unmarshaller;
-import org.jboss.remoting3.RemoteReplyException;
import org.jboss.remoting3.RemoteRequestException;
import org.jboss.remoting3.spi.ReplyHandler;
import org.jboss.remoting3.spi.SpiUtils;
+import org.jboss.xnio.IoUtils;
final class InboundReplyTask implements Runnable {
@@ -49,19 +49,28 @@
try {
final RemoteConnectionHandler connectionHandler = remoteConnectionHandler;
final Unmarshaller unmarshaller =
connectionHandler.getMarshallerFactory().createUnmarshaller(connectionHandler.getMarshallingConfiguration());
- unmarshaller.start(outboundRequest.getByteInput());
- reply = unmarshaller.readObject();
+ try {
+ RemoteConnectionHandler.log.trace("Unmarshalling inbound
reply");
+ unmarshaller.start(outboundRequest.getByteInput());
+ reply = unmarshaller.readObject();
+ unmarshaller.close();
+ RemoteConnectionHandler.log.trace("Unmarshalled inbound reply
%s", reply);
+ } finally {
+ IoUtils.safeClose(unmarshaller);
+ }
} catch (IOException e) {
+ RemoteConnectionHandler.log.trace(e, "Unmarshalling inbound reply
failed");
SpiUtils.safeHandleException(replyHandler, e);
return;
} catch (Exception e) {
+ RemoteConnectionHandler.log.trace(e, "Unmarshalling inbound reply
failed");
SpiUtils.safeHandleException(replyHandler, new RemoteRequestException(e));
return;
+ } catch (Error e) {
+ RemoteConnectionHandler.log.trace(e, "Unmarshalling inbound reply
failed");
+ SpiUtils.safeHandleException(replyHandler, new RemoteRequestException(e));
+ throw e;
}
- try {
- replyHandler.handleReply(reply);
- } catch (IOException e) {
- SpiUtils.safeHandleException(replyHandler, new
RemoteReplyException("Remote reply failed", e));
- }
+ SpiUtils.safeHandleReply(replyHandler, reply);
}
}
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundRequestTask.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundRequestTask.java 2010-02-27
20:42:22 UTC (rev 5762)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/InboundRequestTask.java 2010-02-27
21:47:33 UTC (rev 5763)
@@ -27,6 +27,7 @@
import org.jboss.marshalling.util.IntKeyMap;
import org.jboss.remoting3.RemoteRequestException;
import org.jboss.remoting3.spi.SpiUtils;
+import org.jboss.xnio.IoUtils;
final class InboundRequestTask implements Runnable {
@@ -51,14 +52,27 @@
final Object request;
try {
final Unmarshaller unmarshaller =
remoteConnectionHandler.getMarshallerFactory().createUnmarshaller(remoteConnectionHandler.getMarshallingConfiguration());
- unmarshaller.start(inboundRequest.getByteInput());
- request = unmarshaller.readObject();
+ try {
+ RemoteConnectionHandler.log.trace("Unmarshalling inbound
request");
+ unmarshaller.start(inboundRequest.getByteInput());
+ request = unmarshaller.readObject();
+ unmarshaller.close();
+ RemoteConnectionHandler.log.trace("Unmarshalled inbound request
%s", request);
+ } finally {
+ IoUtils.safeClose(unmarshaller);
+ }
} catch (IOException e) {
+ RemoteConnectionHandler.log.trace(e, "Unmarshalling inbound request
failed");
SpiUtils.safeHandleException(replyHandler, e);
return;
} catch (Exception e) {
+ RemoteConnectionHandler.log.trace(e, "Unmarshalling inbound request
failed");
SpiUtils.safeHandleException(replyHandler, new RemoteRequestException(e));
return;
+ } catch (Error e) {
+ RemoteConnectionHandler.log.trace(e, "Unmarshalling inbound request
failed");
+ SpiUtils.safeHandleException(replyHandler, new RemoteRequestException(e));
+ throw e;
}
final InboundClient inboundClient;
final IntKeyMap<InboundClient> inboundClients =
remoteConnectionHandler.getInboundClients();
Show replies by date