org.apache.cassandra.concurrent
Class DebuggableThreadPoolExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor
All Implemented Interfaces:
java.util.concurrent.Executor, java.util.concurrent.ExecutorService, DebuggableThreadPoolExecutorMBean

public class DebuggableThreadPoolExecutor
extends java.util.concurrent.ThreadPoolExecutor
implements DebuggableThreadPoolExecutorMBean

This is a wrapper class for the ScheduledThreadPoolExecutor. It provides an implementation for the afterExecute() found in the ThreadPoolExecutor class to log any unexpected Runtime Exceptions. Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com )


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
 
Constructor Summary
DebuggableThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, ThreadFactoryImpl threadFactory)
           
DebuggableThreadPoolExecutor(java.lang.String threadPoolName)
           
 
Method Summary
 void afterExecute(java.lang.Runnable r, java.lang.Throwable t)
           
 long getPendingTasks()
           
 void unregisterMBean()
           
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebuggableThreadPoolExecutor

public DebuggableThreadPoolExecutor(java.lang.String threadPoolName)

DebuggableThreadPoolExecutor

public DebuggableThreadPoolExecutor(int corePoolSize,
                                    int maximumPoolSize,
                                    long keepAliveTime,
                                    java.util.concurrent.TimeUnit unit,
                                    java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
                                    ThreadFactoryImpl threadFactory)
Method Detail

unregisterMBean

public void unregisterMBean()

getPendingTasks

public long getPendingTasks()
Specified by:
getPendingTasks in interface DebuggableThreadPoolExecutorMBean

afterExecute

public void afterExecute(java.lang.Runnable r,
                         java.lang.Throwable t)
Overrides:
afterExecute in class java.util.concurrent.ThreadPoolExecutor


Copyright © 2009 The Apache Software Foundation