Class GlobalAPIInvoker

  • All Implemented Interfaces:
    com.helger.scope.IScopeDestructionAware, com.helger.web.scope.singleton.IWebSingleton

    @ThreadSafe
    public class GlobalAPIInvoker
    extends com.helger.web.scope.singleton.AbstractGlobalWebSingleton
    Central API manager. Was reworked in v8.1.4 to clearly separate between registry and invoker.
    Author:
    Philip Helger
    • Field Summary

      • Fields inherited from class com.helger.scope.singleton.AbstractSingleton

        m_aRWLock
    • Constructor Summary

      Constructors 
      Constructor Description
      GlobalAPIInvoker()
      Deprecated.
    • Constructor Detail

      • GlobalAPIInvoker

        @Deprecated(forRemoval=false)
        @UsedViaReflection
        public GlobalAPIInvoker()
        Deprecated.
    • Method Detail

      • resetToDefault

        @VisibleForTesting
        public void resetToDefault()
        Reset all values to default. This is only intended for testing purposes. ATTENTION: this removes ALL registrations!
      • setRegistry

        @Nonnull
        public void setRegistry​(@Nonnull
                                IAPIRegistry aRegistry)
        Set the global registry to be used. Note: this API can only called BEFORE registrations are performed. Afterwards an IllegalStateException is thrown if this API is invoked.
        Parameters:
        aRegistry - The registry to use. May not be null.
      • setInvoker

        @Nonnull
        public void setInvoker​(@Nonnull
                               IAPIInvoker aInvoker)
        Set the global invoker to be used. This can be changed during the runtime of the application and is independent of the registry state. Use this to e.g. increase the debug logging or tracing of the invocations.
        Parameters:
        aInvoker - The invoker to be used. May not be null.
      • toString

        public String toString()
        Overrides:
        toString in class com.helger.scope.singleton.AbstractSingleton