org.licas.call.thread

## Class CallExecutor

- java.lang.Object
- - org.licas.call.thread.CallExecutor

-     public final class CallExecutor
      extends java.lang.Object

  This class implements the `ExecutorService` interface, to allow execution of the client method on a thread pool.
  Author:
    Kieran Greer.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `execute(MethodInfo methodInfo)` Retrieve the correct object and make a call on it.
    `static CallExecutor` | `getInstance()` Get the CallExecutor instance.
    `static void` | `setInstance()` Create the CallExecutor instance with a default number of threads, for example `ServiceConst`.`CALLTHREADS`.
    `static void` | `setInstance(int numberOfThreads)` Create the CallExecutor instance with the indicated number of threads.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### setInstance

          public static void setInstance()

      Create the CallExecutor instance with a default number of threads, for example `ServiceConst`.`CALLTHREADS`. The executor is created only once and so the number of threads can be set only at the start.

    - #### setInstance

          public static void setInstance(int numberOfThreads)

      Create the CallExecutor instance with the indicated number of threads. The executor is created only once and so the number of threads can be set only at the start.
      Parameters:
        `numberOfThreads` - number of threads in the pool.

    - #### getInstance

          public static CallExecutor getInstance()

      Get the CallExecutor instance. If `null` then a default instance is created.
      Returns:
        the call executor instance.

    - #### execute

          public java.lang.Object execute(MethodInfo methodInfo)
                                   throws java.lang.Exception

      Retrieve the correct object and make a call on it.
      Parameters:
        `methodInfo` - the method description.
      Returns:
        Object the reply, or null if there is an error.
      Throws:
        `java.lang.Exception` - any error.