Author: ron.sigal(a)jboss.com
Date: 2008-06-27 21:29:29 -0400 (Fri, 27 Jun 2008)
New Revision: 4329
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java
Log:
JBREM-1005: Uses reflection to call Timer.purge().
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java 2008-06-27
05:51:38 UTC (rev 4328)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java 2008-06-28
01:29:29 UTC (rev 4329)
@@ -23,8 +23,8 @@
package org.jboss.remoting.transport.bisocket;
import java.io.IOException;
-import java.io.InterruptedIOException;
import java.io.OutputStream;
+import java.lang.reflect.Method;
import java.net.Socket;
import java.util.Collections;
import java.util.HashMap;
@@ -47,6 +47,7 @@
import org.jboss.remoting.transport.BidirectionalClientInvoker;
import org.jboss.remoting.transport.socket.SocketClientInvoker;
import org.jboss.remoting.transport.socket.SocketWrapper;
+import org.jboss.remoting.util.SecurityUtility;
import EDU.oswego.cs.dl.util.concurrent.Semaphore;
@@ -626,7 +627,16 @@
controlOutputStream = null;
}
cancel();
- timer.purge();
+
+ try
+ {
+ Method purge = SecurityUtility.getDeclaredMethod(Timer.class,
"purge", new Class[]{});
+ purge.invoke(timer, new Object[]{});
+ }
+ catch (Exception e)
+ {
+ log.debug("running with jdk 1.4: unable to purge Timer");
+ }
}
public void run()
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java 2008-06-27
05:51:38 UTC (rev 4328)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java 2008-06-28
01:29:29 UTC (rev 4329)
@@ -25,6 +25,7 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
@@ -59,6 +60,7 @@
import org.jboss.remoting.transport.PortUtil;
import org.jboss.remoting.transport.socket.LRUPool;
import org.jboss.remoting.transport.socket.SocketServerInvoker;
+import org.jboss.remoting.util.SecurityUtility;
/**
@@ -1200,7 +1202,16 @@
listenerIdToInvokerLocatorMap = null;
controlConnectionThreadMap = null;
cancel();
- timer.purge();
+
+ try
+ {
+ Method purge = SecurityUtility.getDeclaredMethod(Timer.class,
"purge", new Class[]{});
+ purge.invoke(timer, new Object[]{});
+ }
+ catch (Exception e)
+ {
+ log.debug("running with jdk 1.4: unable to purge Timer");
+ }
}
public void run()