congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Executors.privilegedThreadFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
privilegedThreadFactory
method
in
java.util.concurrent.Executors

Best Java code snippets using java.util.concurrent.Executors.privilegedThreadFactory (Showing top 14 results out of 315)

origin: networknt/light-4j

return new InstrumentedThreadFactory(Executors.privilegedThreadFactory(), registry);
origin: networknt/light-4j

return new InstrumentedThreadFactory(Executors.privilegedThreadFactory(), registry, name);
origin: com.virjar/dungproxy-client

public static ThreadFactory privilegedThreadFactory() {
  return Executors.privilegedThreadFactory();
}
origin: com.projectdarkstar.server/sgs-server

  /**
   * {@inheritDoc}
   */
  public ExecutorService newThreadPool() {
    return Executors.newCachedThreadPool(
      Executors.privilegedThreadFactory());
  }
}
origin: org.reddwarfserver.server/sgs-server

  /**
   * {@inheritDoc}
   */
  public ExecutorService newThreadPool() {
    return Executors.newCachedThreadPool(
      Executors.privilegedThreadFactory());
  }
}
origin: org.rapidpm/rapidpm-dependencies-core-reflections

 public ThreadFactory build() {
  //TODO find better ThreadFactory
  if (deamon) {
   return Executors.privilegedThreadFactory();
  }
  return Executors.defaultThreadFactory();
 }
}
origin: dworkin/reddwarf

  /**
   * {@inheritDoc}
   */
  public ExecutorService newThreadPool() {
    return Executors.newCachedThreadPool(
      Executors.privilegedThreadFactory());
  }
}
origin: org.bidib.com.pi4j/pi4j-core

/**
 * return an instance to the thread factory used to create new executor services
 */
private static ThreadFactory getThreadFactory(final String nameFormat) {
  final ThreadFactory defaultThreadFactory = Executors.privilegedThreadFactory();
  return new ThreadFactory() {
    final AtomicLong count = (nameFormat != null) ? new AtomicLong(0) : null;
    @Override
    public Thread newThread(Runnable runnable) {
      Thread thread = defaultThreadFactory.newThread(runnable);
      if (nameFormat != null) {
        thread.setName(String.format(nameFormat, count.getAndIncrement()));
      }
      return thread;
    }
  };
}
origin: io.smallrye/smallrye-fault-tolerance

@PostConstruct
public void initTreadManagerFactory() {
  if (managedThreadFactory != null) {
    threadFactory = managedThreadFactory;
    LOGGER.info("### Managed Thread Factory used ###");
  } else {
    threadFactory = Executors.privilegedThreadFactory();
    LOGGER.info("### Privilleged Thread Factory used ###");
  }
}
origin: geosdi/geo-platform

/**
 * Constructs a new {@code Thread}.  Implementations may also initialize
 * priority, name, daemon status, {@code ThreadGroup}, etc.
 *
 * @param r a runnable to be executed by new thread instance
 * @return constructed thread, or {@code null} if the request to
 * create a thread is rejected
 */
@Override
public Thread newThread(Runnable r) {
  Thread thread = Executors.privilegedThreadFactory().newThread(r);
  thread.setName(this.threadNamePrefix + nextThreadID());
  thread.setPriority(this.priority);
  thread.setDaemon(this.isDaemon);
  return thread;
}
origin: com.networknt/metrics

return new InstrumentedThreadFactory(Executors.privilegedThreadFactory(), registry);
origin: com.networknt/metrics

return new InstrumentedThreadFactory(Executors.privilegedThreadFactory(), registry, name);
origin: cdapio/cdap

@Override
public void upgrade() throws Exception {
 int numThreads = cConf.getInt(Constants.Upgrade.UPGRADE_THREAD_POOL_SIZE);
 ExecutorService executor =
  Executors.newFixedThreadPool(numThreads,
                 new ThreadFactoryBuilder()
                  // all the threads should be created as 'cdap'
                  .setThreadFactory(Executors.privilegedThreadFactory())
                  .setNameFormat("dataset-upgrader-%d")
                  .setDaemon(true)
                  .build());
 try {
  // Upgrade system dataset
  upgradeSystemDatasets(executor);
  // Upgrade all user hbase tables
  upgradeUserTables(executor);
 } finally {
  // We'll have tasks pending in the executor only on an interrupt, when user wants to abort the upgrade.
  // Use shutdownNow() to interrupt the tasks and abort.
  executor.shutdownNow();
 }
}
origin: co.cask.cdap/cdap-data-fabric

new ThreadFactoryBuilder()
 .setThreadFactory(Executors.privilegedThreadFactory())
 .setNameFormat("hbase-queue-upgrader-%d")
 .setDaemon(true)
java.util.concurrentExecutorsprivilegedThreadFactory

Javadoc

Legacy security code; do not use.

Popular methods of Executors

  • newFixedThreadPool
    Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue,
  • newSingleThreadExecutor
    Creates an Executor that uses a single worker thread operating off an unbounded queue, and uses the
  • newCachedThreadPool
    Creates a thread pool that creates new threads as needed, but will reuse previously constructed thre
  • newSingleThreadScheduledExecutor
    Creates a single-threaded executor that can schedule commands to run after a given delay, or to exec
  • newScheduledThreadPool
    Creates a thread pool that can schedule commands to run after a given delay, or to execute periodica
  • defaultThreadFactory
    Returns a default thread factory used to create new threads. This factory creates all new threads us
  • callable
    Returns a Callable object that, when called, runs the given privileged exception action and returns
  • unconfigurableScheduledExecutorService
    Returns an object that delegates all defined ScheduledExecutorService methods to the given executor,
  • unconfigurableExecutorService
    Returns an object that delegates all defined ExecutorService methods to the given executor, but not
  • newWorkStealingPool
    Creates a thread pool that maintains enough threads to support the given parallelism level, and may
  • privilegedCallable
    Legacy security code; do not use.
  • privilegedCallableUsingCurrentClassLoader
    Legacy security code; do not use.
  • privilegedCallable,
  • privilegedCallableUsingCurrentClassLoader

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now