|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RejectedExecutionHandler
An interface for handling rejected executions.
Executor
Method Summary | |
---|---|
void |
handle(java.lang.Runnable runnable,
Executor executor)
Called when a RejectedExecutionException is thrown when the Executor.execute(java.lang.Runnable) method is invoked to handle the rejection. |
Method Detail |
---|
void handle(java.lang.Runnable runnable, Executor executor) throws RejectedExecutionException
Executor.execute(java.lang.Runnable)
method is invoked to handle the rejection.
runnable
- the task to run, guaranteed to be non-null.executor
- the executor, guaranteed to be non-null.
RejectedExecutionException
- thrown if the way to handle the
exception is to throw it.
IMPORTANT Since the executor is passed in, there is nothing to prevent this method to invoke the executor's execute method. But if this handler does call the executor's execute method, it must ensure that this execute call will not trigger this handler which can in turn trigger a call to execute, ultimately resulting in a stack overflow.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |