Package com.yahoo.jdisc.application
Class ContainerThread
- java.lang.Object
-
- java.lang.Thread
-
- com.yahoo.jdisc.application.ContainerThread
-
- All Implemented Interfaces:
Runnable
public class ContainerThread extends Thread
This class decorates
Thread
to allow for internal jDISC optimizations. Whenever possible a jDISC application should use this class instead of Thread. TheContainerThread.Factory
class is a helper-class for working with theExecutors
framework.- Author:
- Simon Thoresen Hult
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContainerThread.Factory
This class implements theThreadFactory
interface on top of aProvider
forMetricConsumer
instances.-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ContainerThread(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 theMetricConsumer
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
-
-
-
-
Constructor Detail
-
ContainerThread
public ContainerThread(Runnable target, MetricConsumer consumer)
Allocates a new ContainerThread object. This constructor calls the parentThread(Runnable)
constructor.- Parameters:
target
- the object whoserun
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.
-
-