69 import java.util.HashMap; |
69 import java.util.HashMap; |
70 import java.util.Map; |
70 import java.util.Map; |
71 import java.util.Properties; |
71 import java.util.Properties; |
72 import java.util.Set; |
72 import java.util.Set; |
73 import java.util.WeakHashMap; |
73 import java.util.WeakHashMap; |
74 import java.util.concurrent.ArrayBlockingQueue; |
|
75 import java.util.concurrent.Executor; |
74 import java.util.concurrent.Executor; |
76 import java.util.concurrent.LinkedBlockingDeque; |
75 import java.util.concurrent.LinkedBlockingQueue; |
77 import java.util.concurrent.ThreadFactory; |
76 import java.util.concurrent.ThreadFactory; |
78 import java.util.concurrent.ThreadPoolExecutor; |
77 import java.util.concurrent.ThreadPoolExecutor; |
79 import java.util.concurrent.TimeUnit; |
78 import java.util.concurrent.TimeUnit; |
80 import javax.management.Attribute; |
79 import javax.management.Attribute; |
81 import javax.management.AttributeList; |
80 import javax.management.AttributeList; |
419 PerThreadGroupPool.Create<ThreadPoolExecutor> create = |
418 PerThreadGroupPool.Create<ThreadPoolExecutor> create = |
420 new PerThreadGroupPool.Create<ThreadPoolExecutor>() { |
419 new PerThreadGroupPool.Create<ThreadPoolExecutor>() { |
421 public ThreadPoolExecutor createThreadPool(ThreadGroup group) { |
420 public ThreadPoolExecutor createThreadPool(ThreadGroup group) { |
422 ThreadFactory daemonThreadFactory = new DaemonThreadFactory( |
421 ThreadFactory daemonThreadFactory = new DaemonThreadFactory( |
423 "JMX RMIConnector listener dispatch %d"); |
422 "JMX RMIConnector listener dispatch %d"); |
424 ThreadPoolExecutor exec = new ThreadPoolExecutor( |
423 ThreadPoolExecutor executor = new ThreadPoolExecutor( |
425 1, 10, 1, TimeUnit.SECONDS, |
424 1, 10, 1, TimeUnit.SECONDS, |
426 new LinkedBlockingDeque<Runnable>(), |
425 new LinkedBlockingQueue<Runnable>(), |
427 daemonThreadFactory); |
426 daemonThreadFactory); |
428 exec.allowCoreThreadTimeOut(true); |
427 executor.allowCoreThreadTimeOut(true); |
429 return exec; |
428 return executor; |
430 } |
429 } |
431 }; |
430 }; |
432 return listenerDispatchThreadPool.getThreadPoolExecutor(create); |
431 return listenerDispatchThreadPool.getThreadPoolExecutor(create); |
433 } |
432 } |
434 |
433 |
1501 private class RMIClientCommunicatorAdmin extends ClientCommunicatorAdmin { |
1500 private class RMIClientCommunicatorAdmin extends ClientCommunicatorAdmin { |
1502 public RMIClientCommunicatorAdmin(long period) { |
1501 public RMIClientCommunicatorAdmin(long period) { |
1503 super(period); |
1502 super(period); |
1504 } |
1503 } |
1505 |
1504 |
1506 public void gotIOException (IOException ioe) throws IOException { |
1505 public void gotIOException(IOException ioe) throws IOException { |
1507 if (ioe instanceof NoSuchObjectException) { |
1506 if (ioe instanceof NoSuchObjectException) { |
1508 // need to restart |
1507 // need to restart |
1509 super.gotIOException(ioe); |
1508 super.gotIOException(ioe); |
1510 |
1509 |
1511 return; |
1510 return; |