Make allowsCoreThreadTimeOut name consistent across mbeans and properties
-------------------------------------------------------------------------

                 Key: SMX4-791
                 URL: https://issues.apache.org/jira/browse/SMX4-791
             Project: ServiceMix 4
          Issue Type: Improvement
            Reporter: Freeman Fang
            Assignee: Freeman Fang


Currently different names are used for properties and different in mbean 
display (and both differs from what is on the thread pool executor)
org.apache.servicemix.nmr.osgi.ExecutorConfigurator has allowCoreThreadsTimeout 
(with 's' and small 'o') and this is the name of the property that should be 
used in config file for it to work (ExecutorConfig in smx-utils has 
allowCoreThreadsTimeout too).

Then ExecutorFactoryImpl uses it to populate allowCoreThreadTimeOut property of 
thread pool executor (no 's', big 'O')

{code}
if (config.isAllowCoreThreadsTimeout()) {
            try {
                Method mth = 
service.getClass().getMethod("allowCoreThreadTimeOut", new 
Class[]{boolean.class});
                mth.invoke(service, new Object[]{Boolean.TRUE});
            }
{code}

and then ManagedExecutor exposes this property as allowsCoreThreadTimeOut 
{code}
public boolean isAllowCoreThreadTimeout() {
        if (this.internalExecutor != null) {
            ThreadPoolExecutor executor = 
this.internalExecutor.getThreadPoolExecutor();
            try {
                Method m = 
ThreadPoolExecutor.class.getMethod("allowsCoreThreadTimeOut", null);
                try {
                    return (Boolean) m.invoke(executor, null);
                } catch (Exception ex) {
{code}

So three versions of the name of the same property. Probably all should be 
changed to the one used on ThreadPoolExecutor as "allowsCoreThreadTimeOut"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to