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
           
 
Field Summary
static int DEFAULT_POOLSIZE
           
static long POLL_MSECS
           
 
Constructor Summary
SelfTuningExecutorService(SelfTuningExecutors executors, ThreadPoolExecutor coreExecutorService, String name, 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 getInitPoolSize()
           
 int getMaximumPoolSize()
           
 String getName()
           
 int getPoolSize()
           
 int getPriority()
           
 int getQueueSize()
           
 int getRunState()
           
protected  Runnable getTask()
           
 double getThroughput()
           
 int getTotalExecutions()
           
 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
 

Field Detail

POLL_MSECS

public static final long POLL_MSECS
See Also:
Constant Field Values

DEFAULT_POOLSIZE

public static final int DEFAULT_POOLSIZE
See Also:
Constant Field Values
Constructor Detail

SelfTuningExecutorService

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

getName

public String getName()
Specified by:
getName in interface SelfTuningExecutorServiceMBean

getQueueSize

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

getInitPoolSize

public int getInitPoolSize()
Specified by:
getInitPoolSize 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

getTotalExecutions

public int getTotalExecutions()
Specified by:
getTotalExecutions 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.