Class ShutdownRejectedExecutionHandler
java.lang.Object
org.jgroups.util.ShutdownRejectedExecutionHandler
- All Implemented Interfaces:
RejectedExecutionHandler
ShutdownRejectedExecutionHandler is a decorator RejectedExecutionHandler used
in all JGroups ThreadPoolExecutor(s). Default RejectedExecutionHandler raises
RuntimeException when a task is submitted to ThreadPoolExecutor that has been
shutdown. ShutdownRejectedExecutionHandler instead logs only a warning
message.
A ThreadPoolExecutor.DiscardPolicy drops a rejected task silently, ie. without raising a
RejectedExecutionException. As callers such as ThreadPool.execute(Runnable) would otherwise treat a
discarded task as accepted, a RejectedExecutionException is raised on the policy's behalf.
- Author:
- Vladimir Blagojevic
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandler()voidrejectedExecution(Runnable r, ThreadPoolExecutor executor)
-
Field Details
-
discards
protected final boolean discards
-
-
Constructor Details
-
ShutdownRejectedExecutionHandler
-
-
Method Details
-
handler
-
rejectedExecution
- Specified by:
rejectedExecutionin interfaceRejectedExecutionHandler
-