diff --git a/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java b/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java index 3771246..828ac99 100644 --- a/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java +++ b/src/main/java/org/apache/servicemix/executors/ExecutorFactory.java @@ -31,7 +31,7 @@ public interface ExecutorFactory { * Configuration properties than can be passed along when creating an executor. * Every ExecutorFactory implementation can support one or more of these options, ignoring the unsupported ones. */ - String ALLOW_CORE_THREADS_TIMEOUT = ExecutorFactory.class.getName() + ".AllowCoreThreadsTimeout"; + String ALLOW_CORE_THREADS_TIMEOUT = ExecutorFactory.class.getName() + ".AllowCoreThreadTimeOut"; String BYPASS_IF_SYNCHRONOUS = ExecutorFactory.class.getName() + ".BypassIfSynchronous"; String CORE_POOL_SIZE = ExecutorFactory.class.getName() + ".CorePoolSize"; String KEEP_ALIVE_TIME = ExecutorFactory.class.getName() + ".KeepAliveTime"; diff --git a/src/main/java/org/apache/servicemix/executors/impl/ExecutorConfig.java b/src/main/java/org/apache/servicemix/executors/impl/ExecutorConfig.java index 033c968..5234f93 100644 --- a/src/main/java/org/apache/servicemix/executors/impl/ExecutorConfig.java +++ b/src/main/java/org/apache/servicemix/executors/impl/ExecutorConfig.java @@ -56,7 +56,7 @@ public class ExecutorConfig { private Long shutdownDelay; - private Boolean allowCoreThreadsTimeout; + private Boolean allowCoreThreadTimeOut; private Boolean bypassIfSynchronous; @@ -80,7 +80,7 @@ public ExecutorConfig(boolean isDefaultConfig, ExecutorConfig parent) { setShutdownDelay(DEFAULT_SHUTDOWN_DELAY); setThreadDaemon(DEFAULT_THREAD_DAEMON); setThreadPriority(DEFAULT_THREAD_PRIORITY); - setAllowCoreThreadsTimeout(DEFAULT_ALLOW_CORE_THREAD_TIMEOUT); + setAllowCoreThreadTimeOut(DEFAULT_ALLOW_CORE_THREAD_TIMEOUT); setBypassIfSynchronous(DEFAULT_BYPASS_IF_SYNCHRONOUS); setCorePoolSize(DEFAULT_CORE_POOL_SIZE); setKeepAliveTime(DEFAULT_KEEP_ALIVE_TIME); @@ -194,18 +194,18 @@ public void setShutdownDelay(Long shutdownDelay) { } /** - * @return the allowCoreThreadsTimeout + * @return the allowCoreThreadTimeOut */ - public Boolean isAllowCoreThreadsTimeout() { - return getParent() != null && allowCoreThreadsTimeout == null ? getParent().isAllowCoreThreadsTimeout() : allowCoreThreadsTimeout; + public Boolean isAllowCoreThreadTimeOut() { + return getParent() != null && allowCoreThreadTimeOut == null ? getParent().isAllowCoreThreadTimeOut() : allowCoreThreadTimeOut; } /** - * @param allowCoreThreadsTimeout - * the allowCoreThreadsTimeout to set + * @param allowCoreThreadTimeOut + * the allowCoreThreadTimeOut to set */ - public void setAllowCoreThreadsTimeout(Boolean allowCoreThreadsTimeout) { - this.allowCoreThreadsTimeout = allowCoreThreadsTimeout; + public void setAllowCoreThreadTimeOut(Boolean allowCoreThreadTimeOut) { + this.allowCoreThreadTimeOut = allowCoreThreadTimeOut; } /** @@ -249,7 +249,7 @@ public static ExecutorConfig create(Map options, ExecutorConfig result.setKeepAliveTime(converter.as(options.get(KEEP_ALIVE_TIME), Long.class)); result.setShutdownDelay(converter.as(options.get(SHUTDOWN_DELAY), Long.class)); - result.setAllowCoreThreadsTimeout(converter.as(options.get(ALLOW_CORE_THREADS_TIMEOUT), Boolean.class)); + result.setAllowCoreThreadTimeOut(converter.as(options.get(ALLOW_CORE_THREADS_TIMEOUT), Boolean.class)); result.setBypassIfSynchronous(converter.as(options.get(BYPASS_IF_SYNCHRONOUS), Boolean.class)); result.setThreadDaemon(converter.as(options.get(THREAD_DAEMON), Boolean.class)); diff --git a/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java b/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java index 8786faf..26e2a13 100644 --- a/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java +++ b/src/main/java/org/apache/servicemix/executors/impl/ExecutorFactoryImpl.java @@ -120,7 +120,7 @@ protected ThreadPoolExecutor createService(String id, ExecutorConfig config) { ThreadPoolExecutor service = new ThreadPoolExecutor(config.getCorePoolSize(), config.getMaximumPoolSize() < 0 ? Integer.MAX_VALUE : config.getMaximumPoolSize(), config .getKeepAliveTime(), TimeUnit.MILLISECONDS, queue, factory, handler); - if (config.isAllowCoreThreadsTimeout()) { + if (config.isAllowCoreThreadTimeOut()) { try { Method mth = service.getClass().getMethod("allowCoreThreadTimeOut", new Class[]{boolean.class}); mth.invoke(service, new Object[]{Boolean.TRUE}); diff --git a/src/main/java/org/apache/servicemix/executors/impl/ManagedExecutor.java b/src/main/java/org/apache/servicemix/executors/impl/ManagedExecutor.java index 03330b1..a8a9fa3 100644 --- a/src/main/java/org/apache/servicemix/executors/impl/ManagedExecutor.java +++ b/src/main/java/org/apache/servicemix/executors/impl/ManagedExecutor.java @@ -102,7 +102,7 @@ public int getQueueSize() { return this.internalExecutor != null ? this.internalExecutor.size() : 0; } - public boolean isAllowCoreThreadTimeout() { + public boolean isAllowCoreThreadTimeOut() { if (this.internalExecutor != null) { ThreadPoolExecutor executor = this.internalExecutor.getThreadPoolExecutor(); try { diff --git a/src/main/java/org/apache/servicemix/executors/impl/ManagedExecutorMBean.java b/src/main/java/org/apache/servicemix/executors/impl/ManagedExecutorMBean.java index 5bad84d..ecef1a8 100644 --- a/src/main/java/org/apache/servicemix/executors/impl/ManagedExecutorMBean.java +++ b/src/main/java/org/apache/servicemix/executors/impl/ManagedExecutorMBean.java @@ -44,7 +44,7 @@ public interface ManagedExecutorMBean { int getQueueSize(); - boolean isAllowCoreThreadTimeout(); + boolean isAllowCoreThreadTimeOut(); long getNumberOfRejectedExecutions(); diff --git a/src/test/java/org/apache/servicemix/executors/impl/ExecutorConfigTest.java b/src/test/java/org/apache/servicemix/executors/impl/ExecutorConfigTest.java index aa127fa..b30a00c 100644 --- a/src/test/java/org/apache/servicemix/executors/impl/ExecutorConfigTest.java +++ b/src/test/java/org/apache/servicemix/executors/impl/ExecutorConfigTest.java @@ -49,7 +49,7 @@ public void testCreateMethod() { assertEquals(new Long(3000), config.getKeepAliveTime()); assertEquals(new Long(9000), config.getShutdownDelay()); assertEquals(new Integer(9), config.getThreadPriority()); - assertEquals(true, config.isAllowCoreThreadsTimeout()); + assertEquals(true, config.isAllowCoreThreadTimeOut()); assertEquals(false, config.isBypassIfSynchronous()); assertEquals(true, config.isThreadDaemon()); } @@ -74,7 +74,7 @@ public void testCreateMethodWithStringValues() { assertEquals(new Long(3000), config.getKeepAliveTime()); assertEquals(new Long(9000), config.getShutdownDelay()); assertEquals(new Integer(9), config.getThreadPriority()); - assertEquals(true, config.isAllowCoreThreadsTimeout()); + assertEquals(true, config.isAllowCoreThreadTimeOut()); assertEquals(false, config.isBypassIfSynchronous()); assertEquals(true, config.isThreadDaemon()); } @@ -99,7 +99,7 @@ public void testCreateMethodIllegalValuesIgnored() { assertEquals(new Long(3000), config.getKeepAliveTime()); assertEquals(new Long(9000), config.getShutdownDelay()); assertEquals(new Integer(9), config.getThreadPriority()); - assertEquals(true, config.isAllowCoreThreadsTimeout()); + assertEquals(true, config.isAllowCoreThreadTimeOut()); assertEquals(false, config.isBypassIfSynchronous()); assertEquals(true, config.isThreadDaemon()); } diff --git a/src/test/java/org/apache/servicemix/executors/impl/ExecutorFactoryImplTest.java b/src/test/java/org/apache/servicemix/executors/impl/ExecutorFactoryImplTest.java index 08da4e4..8e8d368 100644 --- a/src/test/java/org/apache/servicemix/executors/impl/ExecutorFactoryImplTest.java +++ b/src/test/java/org/apache/servicemix/executors/impl/ExecutorFactoryImplTest.java @@ -41,7 +41,7 @@ public void setupExecutorFactory() { defaultConfig.setCorePoolSize(1); defaultConfig.setMaximumPoolSize(2); defaultConfig.setQueueSize(3); - defaultConfig.setAllowCoreThreadsTimeout(true); + defaultConfig.setAllowCoreThreadTimeOut(true); factory.setDefaultConfig(defaultConfig); }