Package gda.jython

Class InterfaceProvider

java.lang.Object
gda.jython.InterfaceProvider

public final class InterfaceProvider extends Object
Static methods to get current implementation for various interfaces supported by JythonServerFacade and JythonServer that are used by other classes in GDA.

Provided to ensure loose coupling between callers and command runner implementation. Allows the use of mock versions of the interfaces to allow stand alone testing

  • Method Details

    • getAliasedCommandProvider

      public static AliasedCommandProvider getAliasedCommandProvider()
      Returns:
      current selected implementation of ICommandRunner
    • getCommandRunner

      public static ICommandRunner getCommandRunner()
      Returns:
      current selected implementation of ICommandRunner
    • getCommandThreadInfoProvider

      public static ICommandThreadInfoProvider getCommandThreadInfoProvider()
      Returns:
      current selected implementation of ICommandRunner
    • getCurrentScanController

      public static ICurrentScanController getCurrentScanController()
      Returns:
      current selected implementation of ICurrentScanController
    • getTerminalPrinter

      public static ITerminalPrinter getTerminalPrinter()
      Returns:
      current selected implementation of ITerminalPrinter
    • getScanStatusHolder

      public static IScanStatusHolder getScanStatusHolder()
      Returns:
      current selected implementation of IScanStatusHolder
    • getScriptController

      public static IScriptController getScriptController()
      Returns:
      current selected implementation of IScriptStatusHolder
    • getCommandAborter

      public static ICommandAborter getCommandAborter()
      Returns:
      current selected implementation of IScriptStatusHolder
    • getJythonNamespace

      public static IJythonNamespace getJythonNamespace()
      Returns:
      current selected implementation of IJythonNamespace
    • getCurrentScanInformationHolder

      public static ICurrentScanInformationHolder getCurrentScanInformationHolder()
      Returns:
      current selected implementation of ICurrentScanInformation
    • getJythonServerNotifer

      public static IJythonServerNotifer getJythonServerNotifer()
      Returns:
      current selected implementation of IJythonServerNotifer
    • getDefaultScannableProvider

      public static IDefaultScannableProvider getDefaultScannableProvider()
      Returns:
      current selected implementation of IDefaultScannableProvider
    • getAuthorisationHolder

      public static IAuthorisationHolder getAuthorisationHolder()
      Returns:
      current selected implementation of IAuthorisationHolder
    • getScanDataPointProvider

      public static IScanDataPointProvider getScanDataPointProvider()
      Returns:
      current selected implementation of IScanDataPointProvider
    • setJSFObserverForTesting

      public static void setJSFObserverForTesting(JSFObserver jSFObserver)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      jSFObserver -
    • getJSFObserver

      public static JSFObserver getJSFObserver()
      Returns:
      current selected implementation of JSFObserver
    • setScanDataPointProviderForTesting

      public static void setScanDataPointProviderForTesting(IScanDataPointProvider scanDataPointProvider)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      scanDataPointProvider -
    • setCommandRunnerForTesting

      public static void setCommandRunnerForTesting(ICommandRunner commandRunner)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      commandRunner -
    • setCurrentScanControllerForTesting

      public static void setCurrentScanControllerForTesting(ICurrentScanController currentScanController)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      currentScanController -
    • setTerminalPrinterForTesting

      public static void setTerminalPrinterForTesting(ITerminalPrinter terminalPrinter)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      terminalPrinter -
    • setScanStatusHolderForTesting

      public static void setScanStatusHolderForTesting(IScanStatusHolder scanStatusHolder)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      scanStatusHolder -
    • setPanicStopForTesting

      public static void setPanicStopForTesting(ICommandAborter panicStop)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      panicStop -
    • setScriptControllerForTesting

      public static void setScriptControllerForTesting(IScriptController scriptController)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      scriptController -
    • setJythonNamespaceForTesting

      public static void setJythonNamespaceForTesting(IJythonNamespace jythonNamespace)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      jythonNamespace -
    • setCurrentScanInformationHolderForTesting

      public static void setCurrentScanInformationHolderForTesting(ICurrentScanInformationHolder currentScanHolder)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      currentScanHolder -
    • setJythonServerNotiferForTesting

      public static void setJythonServerNotiferForTesting(IJythonServerNotifer jythonServerNotifer)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      jythonServerNotifer -
    • setDefaultScannableProviderForTesting

      public static void setDefaultScannableProviderForTesting(IDefaultScannableProvider defaultScannableProvider)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      defaultScannableProvider -
    • setAuthorisationHolderForTesting

      public static void setAuthorisationHolderForTesting(IAuthorisationHolder authorisationHolder)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      authorisationHolder -
    • getBatonStateProvider

      public static IBatonStateProvider getBatonStateProvider()
      Returns:
      current selected implementation of IBatonStateProvider
    • getCompleter

      public static TextCompleter getCompleter()
    • getPathConstructor

      public static IPathConstructor getPathConstructor()
    • setPathConstructorForTesting

      public static void setPathConstructorForTesting(IPathConstructor pathConstructor)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      pathConstructor -
    • setBatonStateProviderForTesting

      public static void setBatonStateProviderForTesting(IBatonStateProvider batonStateProvider)
      call this only when you wish to run outside of gda when JythonServer does not exist
      Parameters:
      batonStateProvider -
    • setAliasedCommandProvider

      public static void setAliasedCommandProvider(AliasedCommandProvider aliasedCommandProvider)
    • getJythonServerStatusProvider

      public static IJythonServerStatusProvider getJythonServerStatusProvider()
    • setJythonServerStatusProviderForTesting

      public static void setJythonServerStatusProviderForTesting(IJythonServerStatusProvider jythonServerStatusProvider)