Author: ron.sigal(a)jboss.com
Date: 2009-04-19 00:30:18 -0400 (Sun, 19 Apr 2009)
New Revision: 5065
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
Log:
JBREM-1123: Added immediateShutdown property.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2009-04-19
04:29:54 UTC (rev 5064)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2009-04-19
04:30:18 UTC (rev 5065)
@@ -25,7 +25,6 @@
import org.jboss.remoting.Home;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.ServerInvoker;
-import org.jboss.remoting.security.ServerSocketFactoryMBean;
import org.jboss.remoting.util.SecurityUtility;
import org.jboss.remoting.util.TimerUtil;
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
@@ -101,6 +100,7 @@
protected int maxPoolSize = MAX_POOL_SIZE_DEFAULT;
protected LRUPool clientpool;
protected LinkedList threadpool;
+ protected boolean immediateShutdown;
protected ServerSocketRefresh refreshThread;
protected boolean newServerSocketFactory = false;
@@ -457,7 +457,14 @@
{
Object o = itr.next();
ServerThread st = (ServerThread) o;
- st.shutdown();
+ if (immediateShutdown)
+ {
+ st.shutdownImmediately();
+ }
+ else
+ {
+ st.shutdown();
+ }
}
clientpool.flush();
@@ -471,7 +478,14 @@
for(int i = 0; i < threadsToShutdown; i++)
{
ServerThread thread = (ServerThread) threadpool.removeFirst();
- thread.shutdown();
+ if (immediateShutdown)
+ {
+ thread.shutdownImmediately();
+ }
+ else
+ {
+ thread.shutdown();
+ }
}
log.debug(this + " stopped threads in threadpool");
@@ -700,6 +714,16 @@
}
}
+ public boolean isImmediateShutdown()
+ {
+ return immediateShutdown;
+ }
+
+ public void setImmediateShutdown(boolean immediateShutdown)
+ {
+ this.immediateShutdown = immediateShutdown;
+ }
+
protected void configureSocket(Socket s) throws SocketException
{
s.setReuseAddress(getReuseAddress());
Show replies by date