Revision: 18312
Author:   [email protected]
Date:     Fri Apr 29 07:09:19 2011
Log:      Update Issue 2536

Committed fix in JAIN SIP, new property is gov.nist.javax.sip.THREAD_PRIORITY.

Updating the MSS executor to recognize its thread names
http://code.google.com/p/mobicents/source/detail?r=18312

Modified:
/trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipApplicationDispatcherImpl.java

=======================================
--- /trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipApplicationDispatcherImpl.java Thu Apr 28 11:18:14 2011 +++ /trunk/servers/sip-servlets/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipApplicationDispatcherImpl.java Fri Apr 29 07:09:19 2011
@@ -43,6 +43,7 @@
 import java.util.concurrent.RejectedExecutionHandler;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
@@ -324,10 +325,19 @@
                messageDispatcherFactory = new MessageDispatcherFactory(this);
                congestionControlThreadPool = new ScheduledThreadPoolExecutor(2,
                                new ThreadPoolExecutor.CallerRunsPolicy());
-               congestionControlThreadPool.prestartAllCoreThreads();
+               congestionControlThreadPool.prestartAllCoreThreads();
+ logger.info("AsynchronousThreadPoolExecutor size is " + StaticServiceHolder.sipStandardService.getDispatcherThreadPoolSize()); asynchronousExecutor = new ThreadPoolExecutor(StaticServiceHolder.sipStandardService.getDispatcherThreadPoolSize(), 64, 90, TimeUnit.SECONDS,
-                               new LinkedBlockingQueue<Runnable>());
- logger.info("AsynchronousThreadPoolExecutor size is " + StaticServiceHolder.sipStandardService.getDispatcherThreadPoolSize());
+                               new LinkedBlockingQueue<Runnable>(), new 
ThreadFactory() {
+                           private int threadCount = 0;
+
+                           public Thread newThread(Runnable pRunnable) {
+                               Thread thread = new Thread(pRunnable, 
String.format("%s-%d",
+                                               "MSS-Executor-Thread", 
threadCount++));
+ thread.setPriority(((SipStackImpl)sipStack).getThreadPriority());
+                               return thread;
+                           }
+        });
asynchronousExecutor.setRejectedExecutionHandler(new RejectedExecutionHandler(){

                        public void rejectedExecution(Runnable r,

Reply via email to