Class ContainerThread

  • All Implemented Interfaces:
    java.lang.Runnable

    public class ContainerThread
    extends java.lang.Thread

    This class decorates Thread to allow for internal jDISC optimizations. Whenever possible a jDISC application should use this class instead of Thread. The ContainerThread.Factory class is a helper-class for working with the Executors framework.

    Author:
    Simon Thoresen Hult
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ContainerThread.Factory
      This class implements the ThreadFactory interface on top of a Provider for MetricConsumer instances.
      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      ContainerThread​(java.lang.Runnable target, MetricConsumer consumer)
      Allocates a new ContainerThread object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MetricConsumer consumer()
      Returns the MetricConsumer of this.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ContainerThread

        public ContainerThread​(java.lang.Runnable target,
                               MetricConsumer consumer)
        Allocates a new ContainerThread object. This constructor calls the parent Thread(Runnable) constructor.
        Parameters:
        target - the object whose run method is called.
        consumer - the MetricConsumer of this thread.
    • Method Detail

      • consumer

        public MetricConsumer consumer()

        Returns the MetricConsumer of this. Note that this may be null.

        Returns:
        The MetricConsumer of this, or null.