net.therore.concurrent
Class SelfTuningExecutorService

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by net.therore.concurrent.SelfTuningExecutorService
All Implemented Interfaces:
Executor, ExecutorService, SelfTuningExecutorServiceMBean

public class SelfTuningExecutorService
extends AbstractExecutorService
implements ExecutorService, SelfTuningExecutorServiceMBean


Nested Class Summary
 class SelfTuningExecutorService.FlowControlWrapper
           
 
Constructor Summary
SelfTuningExecutorService(SelfTuningExecutors executors, ThreadPoolExecutor coreExecutorService, int corePoolSize, int InitPoolSize, int maximumPoolSize, int priority, int queueSize)
           
 
Method Summary
 boolean awaitTermination(long timeout, TimeUnit unit)
           
 void execute(Runnable command)
           
 int getActiveCount()
           
 int getCorePoolSize()
           
 int getMaximumPoolSize()
           
 int getPoolSize()
           
 int getPriority()
           
 int getQueueSize()
           
 int getRunState()
           
protected  Runnable getTask()
           
 double getThroughput()
           
 boolean isShutdown()
           
 boolean isTerminated()
           
 boolean isTerminating()
           
 void shutdown()
           
 List<Runnable> shutdownNow()
           
 
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.ExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit
 

Constructor Detail

SelfTuningExecutorService

public SelfTuningExecutorService(SelfTuningExecutors executors,
                                 ThreadPoolExecutor coreExecutorService,
                                 int corePoolSize,
                                 int InitPoolSize,
                                 int maximumPoolSize,
                                 int priority,
                                 int queueSize)
Method Detail

getQueueSize

public int getQueueSize()
Specified by:
getQueueSize in interface SelfTuningExecutorServiceMBean

getCorePoolSize

public int getCorePoolSize()
Specified by:
getCorePoolSize in interface SelfTuningExecutorServiceMBean

getMaximumPoolSize

public int getMaximumPoolSize()
Specified by:
getMaximumPoolSize in interface SelfTuningExecutorServiceMBean

getPriority

public int getPriority()
Specified by:
getPriority in interface SelfTuningExecutorServiceMBean

getPoolSize

public int getPoolSize()
Specified by:
getPoolSize in interface SelfTuningExecutorServiceMBean

getThroughput

public double getThroughput()
Specified by:
getThroughput in interface SelfTuningExecutorServiceMBean

getActiveCount

public int getActiveCount()
Specified by:
getActiveCount in interface SelfTuningExecutorServiceMBean

getRunState

public int getRunState()

shutdown

public void shutdown()
Specified by:
shutdown in interface ExecutorService
Specified by:
shutdown in interface SelfTuningExecutorServiceMBean

shutdownNow

public List<Runnable> shutdownNow()
Specified by:
shutdownNow in interface ExecutorService
Specified by:
shutdownNow in interface SelfTuningExecutorServiceMBean

isShutdown

public boolean isShutdown()
Specified by:
isShutdown in interface ExecutorService
Specified by:
isShutdown in interface SelfTuningExecutorServiceMBean

isTerminated

public boolean isTerminated()
Specified by:
isTerminated in interface ExecutorService
Specified by:
isTerminated in interface SelfTuningExecutorServiceMBean

isTerminating

public boolean isTerminating()
Specified by:
isTerminating in interface SelfTuningExecutorServiceMBean

awaitTermination

public boolean awaitTermination(long timeout,
                                TimeUnit unit)
                         throws InterruptedException
Specified by:
awaitTermination in interface ExecutorService
Throws:
InterruptedException

execute

public void execute(Runnable command)
Specified by:
execute in interface Executor

getTask

protected Runnable getTask()

Copyright 2014 Alfredo Diaz (therore.net)

Copyright © 2014. All rights reserved.