com.hazelcast.util.executor

## Class HazelcastManagedThread

- java.lang.Object
- - java.lang.Thread
  - - com.hazelcast.util.executor.HazelcastManagedThread

- All Implemented Interfaces:
    Runnable

      public class HazelcastManagedThread
      extends Thread

  Base class for all Hazelcast threads to manage them from a single point. Concrete classes can customize their behaviours by overriding `beforeRun()`, `executeRun()` and `afterRun()` methods.

- - ### Nested Class Summary

    - ### 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 and Description
    `HazelcastManagedThread()`
    `HazelcastManagedThread(Runnable target)`
    `HazelcastManagedThread(Runnable target, String name)`
    `HazelcastManagedThread(String name)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `afterRun()` Called after inner run method and can be overridden to customize.
    `protected void` | `beforeRun()` Called before inner run method and can be overridden to customize.
    `protected void` | `executeRun()` Does the actual run and can be overridden to customize.
    `void` | `run()` Manages the thread lifecycle and can be overridden to customize if needed.
    `void` | `setContextClassLoader(ClassLoader cl)`

    - ### Methods inherited from class java.lang.Thread

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### HazelcastManagedThread

          public HazelcastManagedThread()

    - #### HazelcastManagedThread

          public HazelcastManagedThread(Runnable target)

    - #### HazelcastManagedThread

          public HazelcastManagedThread(String name)

    - #### HazelcastManagedThread

          public HazelcastManagedThread(Runnable target,
                                        String name)

  - ### Method Detail

    - #### setContextClassLoader

          public void setContextClassLoader(ClassLoader cl)

      Overrides:
        `setContextClassLoader` in class `Thread`

    - #### beforeRun

          protected void beforeRun()

      Called before inner run method and can be overridden to customize.

    - #### executeRun

          protected void executeRun()

      Does the actual run and can be overridden to customize.

    - #### afterRun

          protected void afterRun()

      Called after inner run method and can be overridden to customize.

    - #### run

          public void run()

      Manages the thread lifecycle and can be overridden to customize if needed.
      Specified by:
        `run` in interface `Runnable`
      Overrides:
        `run` in class `Thread`

Copyright © 2018. All rights reserved.