Class CallbackMatlabProxy


  • public class CallbackMatlabProxy
    extends java.lang.Object
    Deprecated.
    This class was provided as a workaround when MatlabProxy could not operate on the Event Dispatch Thread (EDT) used by AWT and Swing; MatlabProxy no longer has this limitation. Wraps around a MatlabProxy making the method calls which interact with MATLAB operate with callbacks instead of return values. For each method in MatlabProxy that interacts with MATLAB, the same method exists but has one additional parameter that is either CallbackMatlabProxy.MatlabCallback or CallbackMatlabProxy.MatlabDataCallback. Method invocations do not throw MatlabInvocationExceptions, but if the proxy throws a MatlabInvocationException it will be provided to the callback.

    All interactions with the proxy will be done in a single threaded manner. The underlying proxy methods will be completed in the order their corresponding methods in this class were called. Because method invocations on the proxy occur on a separate thread from the one calling the methods in this class, it can be used from within MATLAB on the Event Dispatch Thread (EDT).

    This class is unconditionally thread-safe. There are no guarantees about the relative ordering of method completion when methods are invoked both on an instance of this class and on the proxy provided to it.
    Since:
    4.0.0
    • Constructor Detail

      • CallbackMatlabProxy

        public CallbackMatlabProxy​(MatlabProxy proxy)
        Deprecated.
        Constructs an instance of this class, delegating all method invocations to the proxy.
        Parameters:
        proxy -
    • Method Detail

      • toString

        public java.lang.String toString()
        Deprecated.
        Returns a brief description. The exact details of this representation are unspecified and are subject to change.
        Overrides:
        toString in class java.lang.Object
        Returns:
      • isConnected

        public void isConnected​(CallbackMatlabProxy.MatlabDataCallback<java.lang.Boolean> callback)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
      • disconnect

        public void disconnect​(CallbackMatlabProxy.MatlabDataCallback<java.lang.Boolean> callback)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
        Parameters:
        callback -
      • exit

        public void exit​(CallbackMatlabProxy.MatlabCallback callback)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
        Parameters:
        callback -
      • eval

        public void eval​(CallbackMatlabProxy.MatlabCallback callback,
                         java.lang.String command)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
        Parameters:
        callback -
        command -
      • returningEval

        public void returningEval​(CallbackMatlabProxy.MatlabDataCallback<java.lang.Object[]> callback,
                                  java.lang.String command,
                                  int nargout)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
        Parameters:
        callback -
        command -
        nargout -
      • feval

        public void feval​(CallbackMatlabProxy.MatlabCallback callback,
                          java.lang.String functionName,
                          java.lang.Object... args)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
        Parameters:
        callback -
        functionName -
        args -
      • returningFeval

        public void returningFeval​(CallbackMatlabProxy.MatlabDataCallback<java.lang.Object[]> callback,
                                   java.lang.String functionName,
                                   int nargout,
                                   java.lang.Object... args)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
        Parameters:
        callback -
        functionName -
        nargout -
        args -
      • setVariable

        public void setVariable​(CallbackMatlabProxy.MatlabCallback callback,
                                java.lang.String variableName,
                                java.lang.Object value)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
        Parameters:
        callback -
        variableName -
        value -
      • getVariable

        public void getVariable​(CallbackMatlabProxy.MatlabDataCallback<java.lang.Object> callback,
                                java.lang.String variableName)
        Deprecated.
        Delegates to the proxy, calling the callback when the proxy's corresponding method has completed.
        Parameters:
        callback -
        variableName -
      • invokeAndWait

        public <U> void invokeAndWait​(MatlabProxy.MatlabThreadCallable<U> callable,
                                      CallbackMatlabProxy.MatlabDataCallback<U> callback)
        Deprecated.
        Delegates to the proxy, calling the callback when the method has been executed.

        The name of this method has been retained for consistency with MatlabProxy, but note that while the code in the callable will be invoked on the MATLAB thread and it will wait until completion so as to return a result, this method - like all others in this class, will not wait for completion. Instead, the result will be provided to the callback.
        Parameters:
        callable -
        callback -