Permalink
Browse files

Allow rejecting executor to have a fixed message

  • Loading branch information...
dmlloyd committed Aug 7, 2009
1 parent 5c09a18 commit 135c777f14301603730ba5b039575d92ef4c4f58
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/main/java/org/jboss/threads/RejectingExecutor.java
@@ -27,11 +27,18 @@
class RejectingExecutor implements DirectExecutor {
static final RejectingExecutor INSTANCE = new RejectingExecutor();
+ private final String message;
+
private RejectingExecutor() {
+ message = null;
+ }
+
+ RejectingExecutor(final String message) {
+ this.message = message;
}
public void execute(final Runnable command) {
- throw new RejectedExecutionException();
+ throw new RejectedExecutionException(message);
}
public String toString() {

0 comments on commit 135c777

Please sign in to comment.