com.mathworks.mps.client

## Interface MWInvokable

-     public interface MWInvokable

  The MWInvocable interface provides methods used to directly invoke MATLAB functions on a MATLAB Production Server instance using a reflection-based proxy object. Client developers do not need to implement this interface. The object returned from `MWClient.createComponentProxy()` is an implementation of this interface.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `invoke(java.lang.String functionName, java.lang.Class<T> targetType, java.lang.Object... inputs)` Invokes a MATLAB function that returns a single value.
    `<T> T` | `invoke(java.lang.String functionName, int nargout, java.lang.Class<T> targetType, java.lang.Object... inputs)` Invokes a MATLAB function that returns multiple values.
    `<T> MWRequest<T>` | `invokeAsync(MWInvokeRequest<T> invokeRequest, MWRequestListener<T> callback)` Invokes a MATLAB function asynchronously with a callback attached.
    `void` | `invokeVoid(java.lang.String functionName, java.lang.Object... inputs)` Invokes a MATLAB function that does not return a value.

- - ### Method Detail

    - #### invoke

          <T> T invoke(java.lang.String functionName,
                       int nargout,
                       java.lang.Class<T> targetType,
                       java.lang.Object... inputs)
                throws java.lang.Throwable

      Invokes a MATLAB function that returns multiple values.
      Type Parameters:
        `T` - The type of the returned object
      Parameters:
        `functionName` - Name of the MATLAB function to be invoked
        `nargout` - Number of output arguments
        `targetType` - Java type for MATLAB output
        `inputs` - Parameters passed to MATLAB function
      Returns:
        A reference to java.lang.Object that contains the output of the MATLAB function being invoked
      Throws:
        `java.lang.Throwable`

    - #### invoke

          <T> T invoke(java.lang.String functionName,
                       java.lang.Class<T> targetType,
                       java.lang.Object... inputs)
                throws java.lang.Throwable

      Invokes a MATLAB function that returns a single value.
      Type Parameters:
        `T` - The type of the returned object
      Parameters:
        `functionName` - Name of the MATLAB function to be invoked
        `targetType` - Java type for MATLAB output
        `inputs` - Parameters passed to MATLAB function
      Returns:
        A reference to java.lang.Object that contains the output of the MATLAB function being invoked
      Throws:
        `java.lang.Throwable`

    - #### invokeVoid

          void invokeVoid(java.lang.String functionName,
                          java.lang.Object... inputs)
                   throws java.lang.Throwable

      Invokes a MATLAB function that does not return a value.
      Parameters:
        `functionName` -
        `inputs` -
      Throws:
        `java.lang.Throwable`

    - #### invokeAsync

          <T> MWRequest<T> invokeAsync(MWInvokeRequest<T> invokeRequest,
                                       MWRequestListener<T> callback)

      Invokes a MATLAB function asynchronously with a callback attached. This guarantees the listener to be attached from the the initial state.
      Type Parameters:
        `T` - The type of the returned object
      Parameters:
        `invokeRequest` - An MWInvokeRequest
        `callback` - A listener object
      Returns:
        A reference to an MWRequest object

Copyright 2010-2022 The MathWorks, Inc.