These must be wrong :
       try {
                try {
                    processorConstructor = processorType
                            .getConstructor(ExecutorService.class);
                    pool[0] = processorConstructor.newInstance(executor);
                } catch (NoSuchMethodException e) {
                    // To the next step...
                }

                try {
                    processorConstructor = processorType
                            .getConstructor(Executor.class);
                    pool[0] = processorConstructor.newInstance(executor);
                } catch (NoSuchMethodException e) {
                    // To the next step...
                }

                try {
                    processorConstructor = processorType.getConstructor();
                    usesExecutorArg = false;
                    pool[0] = processorConstructor.newInstance();
                } catch (NoSuchMethodException e) {
                    // To the next step...
                }
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new RuntimeIoException(
                        "Failed to create a new instance of "
                                + processorType.getName(), e);
            }



Vincent Chan

Reply via email to