Class NamedThreadFactory

java.lang.Object
org.openhab.core.common.NamedThreadFactory
All Implemented Interfaces:
ThreadFactory

public class NamedThreadFactory extends Object implements ThreadFactory
Thread factory that applies a thread name constructed by a supplied identifier.

The thread name will look similar to: OH-id-counter The value of "id" will be replaced with the given ID. The value of "counter" will start from one and increased for every newly created thread.

Author:
Markus Rathgeb - Initial contribution
  • Constructor Details

    • NamedThreadFactory

      public NamedThreadFactory(String id)
      Creates a new named thread factory.

      This constructor will create a new named thread factory using the following parameters:

      • daemonize: false
      • priority: normale
      Parameters:
      id - the identifier used for the thread name creation
    • NamedThreadFactory

      public NamedThreadFactory(String id, boolean daemonize)
      Creates a new named thread factory.

      This constructor will create a new named thread factory using the following parameters:

      • daemonize: false
      Parameters:
      id - the identifier used for the thread name creation
      daemonize - flag if the created thread should be daemonized
    • NamedThreadFactory

      public NamedThreadFactory(String id, boolean daemonize, int priority)
      Creates a new named thread factory.
      Parameters:
      id - the identifier used for the thread name creation
      daemonize - flag if the created threads should be daemonized
      priority - the priority of the created threads
  • Method Details