Author: david.lloyd(a)jboss.com
Date: 2008-07-14 17:03:23 -0400 (Mon, 14 Jul 2008)
New Revision: 4373
Modified:
remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/SpiUtils.java
Log:
safe autoclose convenience method
Modified: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/SpiUtils.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/SpiUtils.java 2008-07-12
15:08:39 UTC (rev 4372)
+++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/spi/SpiUtils.java 2008-07-14
21:03:23 UTC (rev 4373)
@@ -24,6 +24,7 @@
import org.jboss.cx.remoting.spi.remote.ReplyHandler;
import org.jboss.cx.remoting.spi.remote.RemoteRequestContext;
+import org.jboss.cx.remoting.spi.remote.RemoteClientEndpoint;
import org.jboss.cx.remoting.RequestCancelHandler;
import org.jboss.cx.remoting.RequestContext;
import org.jboss.cx.remoting.CloseHandler;
@@ -134,6 +135,14 @@
private static final RemoteRequestContext BLANK_REMOTE_REQUEST_CONTEXT = new
BlankRemoteRequestContext();
+ public static void safeAutoClose(final RemoteClientEndpoint<?, ?>
remoteClientEndpoint) {
+ try {
+ remoteClientEndpoint.autoClose();
+ } catch (Throwable t) {
+ log.error("Failed to set autoClose on %s: %s",
remoteClientEndpoint, t);
+ }
+ }
+
private static final class BlankRemoteRequestContext implements RemoteRequestContext
{
public void cancel(final boolean mayInterrupt) {
}
Show replies by date