[jboss-cvs] JBossAS SVN: r99361 - projects/jboss-threads/trunk/jbossmc/src/main/java/org/jboss/threads/metadata.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 13 16:15:20 EST 2010


Author: david.lloyd at jboss.com
Date: 2010-01-13 16:15:19 -0500 (Wed, 13 Jan 2010)
New Revision: 99361

Modified:
   projects/jboss-threads/trunk/jbossmc/src/main/java/org/jboss/threads/metadata/ThreadsHelper.java
Log:
Fix MBeans, blocking on queueless thread pool

Modified: projects/jboss-threads/trunk/jbossmc/src/main/java/org/jboss/threads/metadata/ThreadsHelper.java
===================================================================
--- projects/jboss-threads/trunk/jbossmc/src/main/java/org/jboss/threads/metadata/ThreadsHelper.java	2010-01-13 21:12:40 UTC (rev 99360)
+++ projects/jboss-threads/trunk/jbossmc/src/main/java/org/jboss/threads/metadata/ThreadsHelper.java	2010-01-13 21:15:19 UTC (rev 99361)
@@ -92,11 +92,11 @@
         entry("WEEKS", "WEEKS")
     );
 
-    static Runnable createTaskFilterTask(final List<Object> objects, final Runnable task) {
+    public static Runnable createTaskFilterTask(final List<Object> objects, final Runnable task) {
         return JBossExecutors.executorTask(createTaskFilter(objects), task);
     }
 
-    static DirectExecutor createTaskFilter(final List<Object> objects) {
+    public static DirectExecutor createTaskFilter(final List<Object> objects) {
         return createTaskFilterRecursive(objects.iterator());
     }
 
@@ -142,27 +142,27 @@
         }
     }
 
-    static Thread createThread(final ThreadFactory threadFactory, final List<Object> taskFilterObjects, final Runnable task) {
+    public static Thread createThread(final ThreadFactory threadFactory, final List<Object> taskFilterObjects, final Runnable task) {
         return threadFactory.newThread(createTaskFilterTask(taskFilterObjects, task));
     }
 
-    static ThreadFactory createThreadFactory(final ThreadGroup threadGroup, final Boolean daemon, final Integer priority, final String namePattern, final Thread.UncaughtExceptionHandler exceptionHandler, final Long stackSize, final List<Object> taskFilterObjects) {
+    public static ThreadFactory createThreadFactory(final ThreadGroup threadGroup, final Boolean daemon, final Integer priority, final String namePattern, final Thread.UncaughtExceptionHandler exceptionHandler, final Long stackSize, final List<Object> taskFilterObjects) {
         return JBossExecutors.wrappingThreadFactory(createTaskFilter(taskFilterObjects), new JBossThreadFactory(threadGroup, daemon, priority, namePattern, exceptionHandler, stackSize));
     }
 
-    static Executor createJBossThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, List<Object> taskFilterObjects) {
+    public static Executor createJBossThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, List<Object> taskFilterObjects) {
         return JBossExecutors.wrappingExecutor(createTaskFilter(taskFilterObjects), new JBossThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory));
     }
 
-    static Executor createThreadFactoryExecutor(final ThreadFactory factory, int maxThreads, boolean blocking, final List<Object> taskFilterObjects) {
+    public static Executor createThreadFactoryExecutor(final ThreadFactory factory, int maxThreads, boolean blocking, final List<Object> taskFilterObjects) {
         return JBossExecutors.threadFactoryExecutor(factory, maxThreads, blocking, createTaskFilter(taskFilterObjects));
     }
 
-    static QueueExecutor createQueueExecutor(final int corePoolSize, final int maxPoolSize, final long keepAliveTime, final TimeUnit keepAliveTimeUnit, final Queue<Runnable> queue, final ThreadFactory threadFactory, final boolean blocking, final Executor handoffExecutor, final List<Object> taskFilterObjects) {
+    public static QueueExecutor createQueueExecutor(final int corePoolSize, final int maxPoolSize, final long keepAliveTime, final TimeUnit keepAliveTimeUnit, final Queue<Runnable> queue, final ThreadFactory threadFactory, final boolean blocking, final Executor handoffExecutor, final List<Object> taskFilterObjects) {
         return new QueueExecutor(corePoolSize, maxPoolSize, keepAliveTime, keepAliveTimeUnit, queue, threadFactory, blocking, handoffExecutor, createTaskFilter(taskFilterObjects)); 
     }
 
-    static QueuelessExecutor createQueuelessExecutor(final ThreadFactory threadFactory, final List<Object> taskFilterObjects, final Executor handoffExecutor, final long idleTimeout) {
+    public static QueuelessExecutor createQueuelessExecutor(final ThreadFactory threadFactory, final List<Object> taskFilterObjects, final Executor handoffExecutor, final long idleTimeout) {
         return new QueuelessExecutor(threadFactory, createTaskFilter(taskFilterObjects), handoffExecutor, idleTimeout);
     }
 
@@ -359,7 +359,7 @@
             }
             builder.addConstructorParameter(List.class.getName(), (ValueMetaData) list);
         }
-        builder.addAnnotation(new LiteralJMX(ThreadPoolExecutorMBean.class, "jboss.threads:type=unboundedQueueThreadPool,name=" + ObjectName.quote(name), false));
+        builder.addAnnotation(new LiteralJMX(ThreadPoolExecutorMBean.class, "jboss.threads:type=unboundedQueueThreadPool,name=" + name, false));
         beanMetaDataList.add(builder.getBeanMetaData());
     }
 
@@ -408,7 +408,7 @@
             }
             builder.addConstructorParameter(List.class.getName(), (ValueMetaData) list);
         }
-        builder.addAnnotation(new LiteralJMX(BoundedQueueThreadPoolExecutorMBean.class, "jboss.threads:type=boundedQueueThreadPool,name=" + ObjectName.quote(name), false));
+        builder.addAnnotation(new LiteralJMX(BoundedQueueThreadPoolExecutorMBean.class, "jboss.threads:type=boundedQueueThreadPool,name=" + name, false));
         beanMetaDataList.add(builder.getBeanMetaData());
     }
 
@@ -450,7 +450,10 @@
         } else {
             builder.addConstructorParameter("long", builder.createValue(Long.valueOf(Long.MAX_VALUE)));
         }
-        builder.addAnnotation(new LiteralJMX(BoundedThreadPoolExecutorMBean.class, "jboss.threads:type=queuelessThreadPool,name=" + ObjectName.quote(name), false));
+        if (metaData.isBlocking()) {
+            builder.addPropertyMetaData("blocking", Boolean.TRUE);
+        }
+        builder.addAnnotation(new LiteralJMX(BoundedThreadPoolExecutorMBean.class, "jboss.threads:type=queuelessThreadPool,name=" + name, false));
         beanMetaDataList.add(builder.getBeanMetaData());
     }
 
@@ -478,7 +481,7 @@
         if (taskFilter != null) {
             throw new UnsupportedOperationException("task-filter not yet supported on scheduled-thread-pool-executor");
         }
-        builder.addAnnotation(new LiteralJMX(ThreadPoolExecutorMBean.class, "jboss.threads:type=scheduledThreadPool,name=" + ObjectName.quote(name), false));
+        builder.addAnnotation(new LiteralJMX(ThreadPoolExecutorMBean.class, "jboss.threads:type=scheduledThreadPool,name=" + name, false));
         beanMetaDataList.add(builder.getBeanMetaData());
     }
 




More information about the jboss-cvs-commits mailing list