Class TracingDaemonPool

  • All Implemented Interfaces:
    com.tangosol.internal.util.DaemonPool, com.tangosol.io.ClassLoaderAware, com.tangosol.util.Controllable, Executor

    public class TracingDaemonPool
    extends Object
    implements com.tangosol.internal.util.DaemonPool
    A DaemonPool implementation that wraps another DaemonPool and adds activation of tracing spans for the Runnables executed by this pool.
    Since:
    20.06
    Author:
    Jonathan Knight 2020.01.10
    • Field Detail

      • f_delegate

        protected final com.tangosol.internal.util.DaemonPool f_delegate
        The DaemonPool to delegate to.
      • f_activeSpan

        protected final Supplier<io.opentracing.Span> f_activeSpan
        The Supplier that will provide active spans.
    • Constructor Detail

      • TracingDaemonPool

        public TracingDaemonPool​(com.tangosol.internal.util.DaemonPool delegate)
        Parameters:
        delegate - the DaemonPool to delegate to
    • Method Detail

      • add

        public void add​(Runnable task)
        Specified by:
        add in interface com.tangosol.internal.util.DaemonPool
      • getDependencies

        public com.tangosol.internal.util.DaemonPoolDependencies getDependencies()
        Specified by:
        getDependencies in interface com.tangosol.internal.util.DaemonPool
      • setDependencies

        public void setDependencies​(com.tangosol.internal.util.DaemonPoolDependencies deps)
        Specified by:
        setDependencies in interface com.tangosol.internal.util.DaemonPool
      • isRunning

        public boolean isRunning()
        Specified by:
        isRunning in interface com.tangosol.util.Controllable
      • isStuck

        public boolean isStuck()
        Specified by:
        isStuck in interface com.tangosol.internal.util.DaemonPool
      • schedule

        public void schedule​(Runnable task,
                             long cMillis)
        Specified by:
        schedule in interface com.tangosol.internal.util.DaemonPool
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.tangosol.util.Controllable
      • start

        public void start()
        Specified by:
        start in interface com.tangosol.util.Controllable
      • stop

        public void stop()
        Specified by:
        stop in interface com.tangosol.util.Controllable
      • configure

        public void configure​(com.tangosol.run.xml.XmlElement xml)
        Specified by:
        configure in interface com.tangosol.util.Controllable
      • getContextClassLoader

        public ClassLoader getContextClassLoader()
        Specified by:
        getContextClassLoader in interface com.tangosol.io.ClassLoaderAware
      • setContextClassLoader

        public void setContextClassLoader​(ClassLoader loader)
        Specified by:
        setContextClassLoader in interface com.tangosol.io.ClassLoaderAware
      • findSpan

        protected io.opentracing.Span findSpan()
        Return the current active span, or try to find the span in the current Context.
        Returns:
        the current active span, or try to find the span in the current Context
      • getDelegate

        protected com.tangosol.internal.util.DaemonPool getDelegate()
        Returns the DaemonPool to delegate to.
        Returns:
        the DaemonPool to delegate to
      • ensureTracingDaemonPool

        public static TracingDaemonPool ensureTracingDaemonPool​(com.tangosol.internal.util.DaemonPool pool)
        Returns a TracingDaemonPool wrapping the specified pool.
        Parameters:
        pool - the pool to wrap or return
        Returns:
        a TracingDaemonPool