Get a thread local transformer factory.

@return The factory.
430244
public static TransformerFactory getTF() {
        TransformerFactory tf = threadTF.get();
        if (tf == null) {
            tf = TransformerFactory.newInstance();
            threadTF.set(tf);
        }
        return tf;
    }
1184955
public static Map<String, Object> get() {
		Map<String, Object> map = JKThreadLocal.thread.get();
		if (map == null) {
			map = new LinkedHashMap<String, Object>();
			JKThreadLocal.set(map);
		}
		return map;
	}
582887
public ThreadContext getThreadContext() {
        if (useInheritableThreadLocal && !SSLConfigManager.getInstance().isServerProcess()) {
            ThreadContext context = inheritableThreadLocStorage.get();

            if (context == null) {
                context = new ThreadContext();
                inheritableThreadLocStorage.set(context);
            }
            return context;
        }
        ThreadContext context = threadLocStorage.get();

        if (context == null) {
            context = new ThreadContext();
            threadLocStorage.set(context);
        }

        return context;
    }
646945
@Nullable
    public static ForkJoinWorkerThreadFactory getDisableInheritableForkJoinWorkerThreadFactory(@Nullable ForkJoinWorkerThreadFactory threadFactory) {
        if (threadFactory == null || isDisableInheritableForkJoinWorkerThreadFactory(threadFactory))
            return threadFactory;

        return new DisableInheritableForkJoinWorkerThreadFactoryWrapper(threadFactory);
    }
327991
public synchronized static HortonMachine getInstance() {
        if (hortonMachine == null) {
            hortonMachine = new HortonMachine(null);
            hortonMachine.gatherInformations();
        }
        return hortonMachine;
    }
743076
@SuppressWarnings("unchecked")
   private static LogAdapterFactory createAdapterFactory()
   {
      List<LogAdapterFactory> factories = Iterators.asList(ServiceLoader.load(LogAdapterFactory.class));
      if (factories.isEmpty())
      {
         /*
          * Always fall back to the JDK, even if our service loading mechanism is hosed for some reason.
          */
         factories = Arrays.asList((LogAdapterFactory) new JDKLogAdapterFactory());
      }

      /*
       * Sort factories by priority.
       */
      Collections.sort(factories, new WeightedComparator());

      /*
       * Use the factory with the highest priority.
       */
      return factories.get(0);

   }
340846
protected final QueueFactory getQueueFactory_()
	{
		QueueFactory queueFactory=getQueueFactory();
		if(queueFactory==null)
		{
			queueFactory=getDefaultQueueFactory();
		}
		return queueFactory;
	}
380784
public static ThreadFactory getThreadFactory(
            final String groupName,
            final String name,
            final int stackSize,
            final boolean incrementThreadNames,
            final Queue<String> coreList) {
        ThreadGroup group = null;
        if (groupName != null) {
            group = new ThreadGroup(Thread.currentThread().getThreadGroup(), groupName);
        }
        final ThreadGroup finalGroup = group;

        return new ThreadFactory() {
            private final AtomicLong m_createdThreadCount = new AtomicLong(0);
            private final ThreadGroup m_group = finalGroup;
            @Override
            public synchronized Thread newThread(final Runnable r) {
                final String threadName = name +
                        (incrementThreadNames ? " - " + m_createdThreadCount.getAndIncrement() : "");
                String coreTemp = null;
                if (coreList != null && !coreList.isEmpty()) {
                    coreTemp = coreList.poll();
                }
                final String core = coreTemp;
                Runnable runnable = new Runnable() {
                    @Override
                    public void run() {
                        if (core != null) {
                            // Remove Affinity for now to make this dependency dissapear from the client.
                            // Goal is to remove client dependency on this class in the medium term.
                            //PosixJNAAffinity.INSTANCE.setAffinity(core);
                        }
                        try {
                            r.run();
                        } catch (Throwable t) {
                            new VoltLogger("HOST").error("Exception thrown in thread " + threadName, t);
                        } finally {
                            m_threadLocalDeallocator.run();
                        }
                    }
                };

                Thread t = new Thread(m_group, runnable, threadName, stackSize);
                t.setDaemon(true);
                return t;
            }
        };
    }
399540
public static JKExceptionHandlerFactory getInstance() {
		if (JKExceptionHandlerFactory.instance == null) {
			JKExceptionHandlerFactory.instance = new JKExceptionHandlerFactory();
		}
		return JKExceptionHandlerFactory.instance;
	}
1227129
static ThreadFactory getNamedThreadFactory(final String prefix) {
    SecurityManager s = System.getSecurityManager();
    final ThreadGroup threadGroup = (s != null) ? s.getThreadGroup() :
        Thread.currentThread().getThreadGroup();

    return new ThreadFactory() {
      private final AtomicInteger threadNumber = new AtomicInteger(1);
      private final int poolNum = POOLNUMBER.getAndIncrement();
      private final ThreadGroup group = threadGroup;

      @Override
      public Thread newThread(Runnable r) {
        final String name =
            prefix + "-pool" + poolNum + "-t" + threadNumber.getAndIncrement();
        return new Thread(group, r, name);
      }
    };
  }
746440
public static <I, O> JMConcurrentProcessor<I, O> buildWithThreadPool(
            Function<I, O> transformerFunction) {
        return buildWithThreadPool(OS.getAvailableProcessors(),
                transformerFunction);
    }
162813
public static ThreadManager getInstance() {
        if (thisClass == null) {
            thisClass = new ThreadManager();

            String useInheritableThreadLocalString = SSLConfigManager.getInstance().getGlobalProperty(Constants.SSLPROP_USE_INHERITABLE_THREAD_LOCAL);
            if (useInheritableThreadLocalString != null && (useInheritableThreadLocalString.equalsIgnoreCase("true") || useInheritableThreadLocalString.equalsIgnoreCase("yes"))) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "useInheritableThreadLocal is enabled.");
                useInheritableThreadLocal = true;
            }
        }

        return thisClass;
    }
1059944
protected function getAdapterFactory()
    {
        if (!isset($this->factoryCache[$this->id])) {
            $config = config('jwt');
            if (isset($this->config['adapter'])) {
                $config = array_merge($config, $this->config['adapter']);
            }
            $factoryClass = $this->getAdapterFactoryClass();
            $this->factoryCache[$this->id] = new $factoryClass($config);
        }
        return $this->factoryCache[$this->id];
    }
86093
public static TensorFactory getFactory() {
    return new TensorFactory() {
      @Override
      public TensorBuilder getBuilder(int[] dimNums, int[] dimSizes) {
        return new SparseTensorBuilder(dimNums, dimSizes);
      }
    };
  }
75988
public Factory getMessageFactory()
    {
        return new Factory()
        {
            @Override
            public ThriftMessage create(ChannelBuffer messageBuffer)
            {
                return new ThriftMessage(messageBuffer, getTransportType());
            }
        };
    }
778611
public static ThreadPoolExecutor createDefaultExecutorService() {
        ThreadFactory threadFactory = new ThreadFactory() {
            private int threadCount = 1;

            public Thread newThread(Runnable r) {
                Thread thread = new Thread(r);
                thread.setName("s3-transfer-manager-worker-" + threadCount++);
                return thread;
            }
        };
        return (ThreadPoolExecutor)Executors.newFixedThreadPool(10, threadFactory);
    }
393206
public final function getFactory()
    {
        $calledClass = get_called_class();
        if (empty(self::$factories[$calledClass])) {
            self::$factories[$calledClass] = $this->getDefaultFactory();
        }

        return self::$factories[$calledClass];
    }