com.atlassian.confluence.event
Class CpuBasedThreadPoolConfiguration

java.lang.Object
  extended by com.atlassian.confluence.event.CpuBasedThreadPoolConfiguration
All Implemented Interfaces:
com.atlassian.event.config.EventThreadPoolConfiguration

public class CpuBasedThreadPoolConfiguration
extends java.lang.Object
implements com.atlassian.event.config.EventThreadPoolConfiguration

EventThreadPoolConfiguration implementation that creates configuration for ThreadPoolExecutor based on cpus available.

It's possible to override this behaviour via CORE_POOL_SIZE_KEY, MAXIMUM_POOL_SIZE_KEY, QUEUE_SIZE_KEY system properties

Since:
5.5

Field Summary
static java.lang.String CORE_POOL_SIZE_KEY
           
static java.lang.String MAXIMUM_POOL_SIZE_KEY
           
protected static int QUEUE_SIZE
          Size of ThreadPoolExecutor.workQueue
static java.lang.String QUEUE_SIZE_KEY
           
 
Constructor Summary
CpuBasedThreadPoolConfiguration()
           
 
Method Summary
 int getCorePoolSize()
           
 long getKeepAliveTime()
           
 int getMaximumPoolSize()
           
 java.util.concurrent.TimeUnit getTimeUnit()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_POOL_SIZE_KEY

public static final java.lang.String CORE_POOL_SIZE_KEY
See Also:
Constant Field Values

MAXIMUM_POOL_SIZE_KEY

public static final java.lang.String MAXIMUM_POOL_SIZE_KEY
See Also:
Constant Field Values

QUEUE_SIZE_KEY

public static final java.lang.String QUEUE_SIZE_KEY
See Also:
Constant Field Values

QUEUE_SIZE

protected static final int QUEUE_SIZE
Size of ThreadPoolExecutor.workQueue

Constructor Detail

CpuBasedThreadPoolConfiguration

public CpuBasedThreadPoolConfiguration()
Method Detail

getCorePoolSize

public int getCorePoolSize()
Specified by:
getCorePoolSize in interface com.atlassian.event.config.EventThreadPoolConfiguration

getMaximumPoolSize

public int getMaximumPoolSize()
Specified by:
getMaximumPoolSize in interface com.atlassian.event.config.EventThreadPoolConfiguration

getKeepAliveTime

public long getKeepAliveTime()
Specified by:
getKeepAliveTime in interface com.atlassian.event.config.EventThreadPoolConfiguration

getTimeUnit

public java.util.concurrent.TimeUnit getTimeUnit()
Specified by:
getTimeUnit in interface com.atlassian.event.config.EventThreadPoolConfiguration


Copyright © 2003-2014 Atlassian. All Rights Reserved.