org.licas.call

## Class CallObject

- java.lang.Object
- - org.licas.call.CallObject

-     public final class CallObject
      extends java.lang.Object

  This class is used to execute a method call on a local or remote service, or on any Object. If the services are running on the same server, then the call can be local, through either a direct reference to the service, or through server lookup using the service address. If the call is remote - to a different server, then a remote method handler is created that can invoke the remote server with the method invocation instructions. Any other object can also be invoked through `Reflection`.

  The method invocation is now done using the java concurrent classes of 1.5+, where a `Callable` and `Future` interfaces are used to execute the methods on a managed thread pool. This is the main calling mechanism that makes a single invocation on a single object. See also `CallPool` for a managed pool of CallObjects.

  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CallObject()` Creates a new instance of CallObject

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `call(MethodInfo methodInfo)` Retrieve the correct communication object and make a call using it.

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

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

- - ### Constructor Detail

    - #### CallObject

          public CallObject()

      Creates a new instance of CallObject

  - ### Method Detail

    - #### call

          public java.lang.Object call(MethodInfo methodInfo)
                                throws LicasException,
                                       ServiceException,
                                       java.lang.Exception

      Retrieve the correct communication object and make a call using it. With the mobile platform, `REST` communication works best and so it may be necessary to use a `Rest_MethodHandler` and parse the String reply. In that case, the operating system would be defined as Android (`Const`.`OS` = `Const.ANDROID`).
      Parameters:
        `methodInfo` - the method description.
      Returns:
        the reply as any object.
      Throws:
        `LicasException` - if the call handle has not been properly constructed.
        `ServiceException` - probably for password or service not found.
        `java.lang.Exception` - any other error.