java.lang.Object
com.jacob.com.JacobObject
com.jacob.com.Dispatch
de.tracetronic.jenkins.plugins.ecutest.wrapper.com.ETComDispatch
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
AbstractTestObject, AnalysisEnvironment, AnalysisExecutionInfo, Cache, Caches, Constants, TestBenchConfiguration, TestConfiguration, TestEnvironment, TestExecutionInfo, TestManagement

public class ETComDispatch extends com.jacob.com.Dispatch implements AutoCloseable
Custom dispatch to perform requests on application specific COM API.

All threads from COM will be automatically released after performing the requests.

  • Field Summary

    Fields inherited from class com.jacob.com.Dispatch

    fdexNameCaseSensitive, Get, LOCALE_SYSTEM_DEFAULT, m_pDispatch, Method, Put, PutRef
  • Constructor Summary

    Constructors
    Constructor
    Description
    ETComDispatch(boolean useTimeout)
    Instantiates a new ETComDispatch with default programmatic identifier.
    ETComDispatch(com.jacob.com.Dispatch dispatch, boolean useTimeout)
    Instantiates a new ETComDispatch.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this ETComDispatch quietly.
    protected void
     
    boolean
     
    protected com.jacob.com.Variant
    Performs a direct synchronous request on this ETComDispatch, invoking the given method and waiting for the result.
    protected com.jacob.com.Variant
    performDirectRequest(String method, Object... params)
    Performs a direct synchronous request on this ETComDispatch, invoking the given method with parameters and waiting for the result.
    protected com.jacob.com.Variant
    Performs a request on this ETComDispatch, invoking the given method.
    protected com.jacob.com.Variant
    performRequest(String method, int timeout)
    Performs a request on this ETComDispatch, invoking the given method.
    protected com.jacob.com.Variant
    performRequest(String method, int timeout, Object... params)
    Performs a request on this ETComDispatch, invoking the given method with parameters.
    protected com.jacob.com.Variant
    performRequest(String method, Object... params)
    Performs a request on this ETComDispatch, invoking the given method with parameters.
    boolean
    Returns whether to apply COM timeout.

    Methods inherited from class com.jacob.com.Dispatch

    call, call, call, call, callN, callN, callN_CaseSensitive, callSub, callSub, callSub, callSub, callSubN, callSubN, coCreateInstance, get, get, get_CaseSensitive, getActiveInstance, getIDOfName, getIDsOfNames, getIDsOfNames, getProgramId, hasExited, hasExited, invoke, invoke, invoke, invokeSub, invokeSub, invokeSub, invokeSubv, invokeSubv, invokeSubv, invokev, invokev, invokev, invokev, put, put, put_Casesensitive, putRef, putRef, QueryInterface, safeRelease

    Methods inherited from class com.jacob.com.JacobObject

    debug, getBuildDate, getBuildVersion, isDebugEnabled

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ETComDispatch

      public ETComDispatch(boolean useTimeout)
      Instantiates a new ETComDispatch with default programmatic identifier.
      Parameters:
      useTimeout - specifies whether to apply timeout
    • ETComDispatch

      public ETComDispatch(com.jacob.com.Dispatch dispatch, boolean useTimeout)
      Instantiates a new ETComDispatch.

      This constructor is used instead of a case operation to turn a Dispatch object into a wider object - it must exist in every wrapper class whose instances may be returned from method calls wrapped in VT_DISPATCH Variants.

      Parameters:
      dispatch - the dispatch
      useTimeout - specifies whether to apply timeout
  • Method Details

    • useTimeout

      public boolean useTimeout()
      Returns whether to apply COM timeout.
      Returns:
      true if positive timeout is set, false otherwise
    • performRequest

      protected com.jacob.com.Variant performRequest(String method) throws ETComException
      Performs a request on this ETComDispatch, invoking the given method.
      Parameters:
      method - the specific COM API method name
      Returns:
      the Variant returned by underlying callN
      Throws:
      ETComException - the underlying JacobException
    • performRequest

      protected com.jacob.com.Variant performRequest(String method, int timeout) throws ETComException
      Performs a request on this ETComDispatch, invoking the given method. Respects the given timeout and aborts the dispatch call if timeout exceeded.
      Parameters:
      method - the specific COM API method name
      timeout - the timeout in seconds
      Returns:
      the Variant returned by underlying callN
      Throws:
      ETComException - the underlying JacobException
    • performRequest

      protected com.jacob.com.Variant performRequest(String method, Object... params) throws ETComException
      Performs a request on this ETComDispatch, invoking the given method with parameters.
      Parameters:
      method - the parameterized COM API method name
      params - the parameters for the method
      Returns:
      the Variant returned by underlying callN
      Throws:
      ETComException - the underlying JacobException
    • performRequest

      protected com.jacob.com.Variant performRequest(String method, int timeout, Object... params) throws ETComException
      Performs a request on this ETComDispatch, invoking the given method with parameters. Respects the given timeout and aborts the dispatch call if timeout exceeded.
      Parameters:
      method - the parameterized COM API method name
      timeout - the timeout in seconds
      params - the parameters for the method
      Returns:
      the Variant returned by underlying callN
      Throws:
      ETComException - the underlying JacobException
    • performDirectRequest

      protected com.jacob.com.Variant performDirectRequest(String method) throws ETComException
      Performs a direct synchronous request on this ETComDispatch, invoking the given method and waiting for the result.
      Parameters:
      method - the specific COM API method name
      Returns:
      the Variant returned by underlying callN
      Throws:
      ETComException - the underlying JacobException
    • performDirectRequest

      protected com.jacob.com.Variant performDirectRequest(String method, Object... params) throws ETComException
      Performs a direct synchronous request on this ETComDispatch, invoking the given method with parameters and waiting for the result.
      Parameters:
      method - the parameterized COM API method name
      params - the parameters for the method
      Returns:
      the Variant returned by underlying callN
      Throws:
      ETComException - the underlying JacobException
    • isAttached

      public boolean isAttached()
      Overrides:
      isAttached in class com.jacob.com.Dispatch
    • close

      public void close()
      Closes this ETComDispatch quietly.
      Specified by:
      close in interface AutoCloseable
    • finalize

      protected void finalize()
      Overrides:
      finalize in class com.jacob.com.Dispatch