Class LDAPSDKThreadFactory

  • All Implemented Interfaces:
    java.util.concurrent.ThreadFactory

    @Mutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class LDAPSDKThreadFactory
    extends java.lang.Object
    implements java.util.concurrent.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 Summary

      Constructors 
      Constructor Description
      LDAPSDKThreadFactory​(java.lang.String baseName, boolean daemon)
      Creates a new instance of this thread factory with the provided settings.
      LDAPSDKThreadFactory​(java.lang.String baseName, boolean daemon, java.lang.ThreadGroup threadGroup)
      Creates a new instance of this thread factory with the provided settings.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Thread newThread​(java.lang.Runnable r)
      Creates a new thread using the settings for this thread factory.
      • Methods inherited from class java.lang.Object

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

      • LDAPSDKThreadFactory

        public LDAPSDKThreadFactory​(@NotNull
                                    java.lang.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
                                    java.lang.String baseName,
                                    boolean daemon,
                                    @Nullable
                                    java.lang.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 Detail

      • newThread

        @NotNull
        public java.lang.Thread newThread​(@NotNull
                                          java.lang.Runnable r)
        Creates a new thread using the settings for this thread factory. The new thread will not be started.
        Specified by:
        newThread in interface java.util.concurrent.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.