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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 10 20:20:32 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-08-10 20:20:32 -0400 (Mon, 10 Aug 2009)
New Revision: 92214

Modified:
   projects/jboss-threads/trunk/main/src/main/java/org/jboss/threads/JBossExecutors.java
Log:
Allow rejecting executor to have a fixed message (pt 2)

Modified: projects/jboss-threads/trunk/main/src/main/java/org/jboss/threads/JBossExecutors.java
===================================================================
--- projects/jboss-threads/trunk/main/src/main/java/org/jboss/threads/JBossExecutors.java	2009-08-11 00:08:59 UTC (rev 92213)
+++ projects/jboss-threads/trunk/main/src/main/java/org/jboss/threads/JBossExecutors.java	2009-08-11 00:20:32 UTC (rev 92214)
@@ -92,6 +92,16 @@
     }
 
     /**
+     * Get a rejecting executor.  This executor will reject any task submitted to it with the given message.
+     *
+     * @param message the reject message
+     * @return the rejecting executor instance
+     */
+    public static DirectExecutor rejectingExecutor(final String message) {
+        return new RejectingExecutor(message);
+    }
+
+    /**
      * Get the rejecting executor service.  This executor will reject any task submitted to it.  It cannot be shut down.
      *
      * @return the rejecting executor service instance
@@ -101,6 +111,17 @@
     }
 
     /**
+     * Get the rejecting executor service.  This executor will reject any task submitted to it with the given message.
+     * It cannot be shut down.
+     *
+     * @param message the reject message
+     * @return the rejecting executor service instance
+     */
+    public static DirectExecutorService rejectingExecutorService(final String message) {
+        return protectedDirectExecutorService(rejectingExecutor(message));
+    }
+
+    /**
      * Get the discarding executor.  This executor will silently discard any task submitted to it.
      *
      * @return the discarding executor instance




More information about the jboss-cvs-commits mailing list