Class LDAPSDKThreadFactory

java.lang.Object
com.unboundid.util.LDAPSDKThreadFactory
All Implemented Interfaces:
ThreadFactory

This class provides a thread factory implementation that may be used to create threads with a number of basic settings. The name of each thread will be followed by a counter indicating the order in which the thread was created.
  • Constructor Details

    • LDAPSDKThreadFactory

      public LDAPSDKThreadFactory(@NotNull String baseName, boolean daemon)
      Creates a new instance of this thread factory with the provided settings. Threads created will have the default thread group.
      Parameters:
      baseName - The base name to use for threads created by this factory.
      daemon - Indicates whether the threads should be created as daemon threads.
    • LDAPSDKThreadFactory

      public LDAPSDKThreadFactory(@NotNull String baseName, boolean daemon, @Nullable ThreadGroup threadGroup)
      Creates a new instance of this thread factory with the provided settings.
      Parameters:
      baseName - The base name to use for threads created by this factory. It must not be null.
      daemon - Indicates whether the threads should be created as daemon threads.
      threadGroup - The thread group to use for threads created by this factory. It may be null if the default thread group should be used.
  • Method Details

    • newThread

      Creates a new thread using the settings for this thread factory. The new thread will not be started.
      Specified by:
      newThread in interface ThreadFactory
      Parameters:
      r - The Runnable target that will be used for the actual thread logic. It must not be null.
      Returns:
      The newly-created (but not yet started) thread.