Author: elecharny Date: Wed Oct 6 20:25:44 2010 New Revision: 1005233 URL: http://svn.apache.org/viewvc?rev=1005233&view=rev Log: o Added some missing Javadoc o Improved the way we try to instanciate a processor
Modified: mina/branches/2.0.1/mina-core/src/main/java/org/apache/mina/core/service/SimpleIoProcessorPool.java Modified: mina/branches/2.0.1/mina-core/src/main/java/org/apache/mina/core/service/SimpleIoProcessorPool.java URL: http://svn.apache.org/viewvc/mina/branches/2.0.1/mina-core/src/main/java/org/apache/mina/core/service/SimpleIoProcessorPool.java?rev=1005233&r1=1005232&r2=1005233&view=diff ============================================================================== --- mina/branches/2.0.1/mina-core/src/main/java/org/apache/mina/core/service/SimpleIoProcessorPool.java (original) +++ mina/branches/2.0.1/mina-core/src/main/java/org/apache/mina/core/service/SimpleIoProcessorPool.java Wed Oct 6 20:25:44 2010 @@ -137,6 +137,7 @@ public class SimpleIoProcessorPool<T ext * * @param processorType The type of IoProcessor to use * @param executor The {...@link Executor} + * @param size The number of IoProcessor in the pool */ @SuppressWarnings("unchecked") public SimpleIoProcessorPool(Class<? extends IoProcessor<T>> processorType, @@ -171,23 +172,21 @@ public class SimpleIoProcessorPool<T ext try { processorConstructor = processorType.getConstructor(ExecutorService.class); pool[0] = processorConstructor.newInstance(this.executor); - } catch (NoSuchMethodException e) { - // To the next step... - } - - try { - processorConstructor = processorType.getConstructor(Executor.class); - pool[0] = processorConstructor.newInstance(this.executor); - } catch (NoSuchMethodException e) { - // To the next step... - } - - try { - processorConstructor = processorType.getConstructor(); - usesExecutorArg = false; - pool[0] = processorConstructor.newInstance(); - } catch (NoSuchMethodException e) { + } catch (NoSuchMethodException e1) { // To the next step... + try { + processorConstructor = processorType.getConstructor(Executor.class); + pool[0] = processorConstructor.newInstance(this.executor); + } catch (NoSuchMethodException e2) { + // To the next step... + try { + processorConstructor = processorType.getConstructor(); + usesExecutorArg = false; + pool[0] = processorConstructor.newInstance(); + } catch (NoSuchMethodException e3) { + // To the next step... + } + } } } catch (RuntimeException re) { LOGGER.error("Cannot create an IoProcessor :{}", re.getMessage());