Class FixedAffinityPinnedThreadFactory

  • All Implemented Interfaces:
    java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory, java.util.concurrent.ThreadFactory, PinnedThreadFactory

    public final class FixedAffinityPinnedThreadFactory
    extends java.lang.Object
    implements PinnedThreadFactory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.sheinbergon.needle.PinnedThread newThread​(java.lang.Runnable r)
      Constructs a new PinnedThread.
      org.sheinbergon.needle.PinnedThread.ForkJoinWorker newThread​(java.util.concurrent.ForkJoinPool pool)  
      • Methods inherited from class java.lang.Object

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

      • FixedAffinityPinnedThreadFactory

        public FixedAffinityPinnedThreadFactory()
    • Method Detail

      • newThread

        public org.sheinbergon.needle.PinnedThread newThread​(@Nonnull
                                                             java.lang.Runnable r)
        Description copied from interface: PinnedThreadFactory
        Constructs a new PinnedThread.
        Specified by:
        newThread in interface PinnedThreadFactory
        Specified by:
        newThread in interface java.util.concurrent.ThreadFactory
        Parameters:
        r - a runnable to be executed by new thread instance
        Returns:
        instantiated PinnedThread, or null if the request to create a thread is rejected
      • newThread

        public org.sheinbergon.needle.PinnedThread.ForkJoinWorker newThread​(@Nonnull
                                                                            java.util.concurrent.ForkJoinPool pool)
        Specified by:
        newThread in interface java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory
        Specified by:
        newThread in interface PinnedThreadFactory
        Parameters:
        pool - the pool this pinned worker thread operates in
        Returns:
        the pinned worker thread, or null if the implementation rejects its inception