ariba.util.core
Interface RejectedExecutionHandler

All Known Implementing Classes:
DefaultRejectedExecutionHandler, ThreadPoolRejectedExecutionHandler

public interface RejectedExecutionHandler

An interface for handling rejected executions.

See Also:
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

handle

void handle(java.lang.Runnable runnable,
            Executor executor)
            throws RejectedExecutionException
Called when a RejectedExecutionException is thrown when the Executor.execute(java.lang.Runnable) method is invoked to handle the rejection.

Parameters:
runnable - the task to run, guaranteed to be non-null.
executor - the executor, guaranteed to be non-null.
Throws:
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.



AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.