Examples of ThreadFactory


Examples of java.util.concurrent.ThreadFactory

   *
   * @param prefix  The prefix of every created Thread's name
   * @return a {@link java.util.concurrent.ThreadFactory} that names threads
   */
  public static ThreadFactory getNamedThreadFactory(final String prefix) {
    return new ThreadFactory() {

      private final AtomicInteger threadNumber = new AtomicInteger(1);
     
      @Override
      public Thread newThread(Runnable r) {
View Full Code Here

Examples of java.util.concurrent.ThreadFactory

    // there's files to split. It then fires up everything, waits for
    // completion and finally checks for any exception
    int nbFiles = hstoreFilesToSplit.size();
    ThreadFactoryBuilder builder = new ThreadFactoryBuilder();
    builder.setNameFormat("StoreFileSplitter-%1$d");
    ThreadFactory factory = builder.build();
    ThreadPoolExecutor threadPool =
      (ThreadPoolExecutor) Executors.newFixedThreadPool(nbFiles, factory);
    List<Future<Void>> futures = new ArrayList<Future<Void>>(nbFiles);

     // Split each store file.
View Full Code Here

Examples of molecule.platform.ThreadFactory

     *
     * @param pool the pool this thread works in
     * @throws NullPointerException if pool is null
     */
    protected ForkJoinWorkerThread(final ForkJoinPool pool) {
      this(pool, new ThreadFactory("fork-join", true))
    }
View Full Code Here

Examples of org.apache.axis2.util.threadpool.ThreadFactory

        EventingConfigData eventingConfigData = PublisherUtils.getActivityPublisherAdmin().getEventingConfigData();

        if (((Counter) value).getCount() > eventingConfigData.getMessageThreshold()) {
            synchronized (eventingConfigData) {
                ConfigurationContext configContxt = new ConfigurationContext(axisConfiguration);
                ThreadFactory threadFactory = configContxt.getThreadPool();

                EventGenarator thread = new EventGenarator(messageContext, null, eventingConfigData
                        .getMessageThreshold(), eventElement, true, false, false, getMessageMap(), null, null);
                threadFactory.execute(thread);

                setMessageMap(new ConcurrentHashMap<String, Map<String, OMElement>>());

                Counter messageCounter = new Counter();
                messageCounter.resetMessageCount(messageContext);
View Full Code Here

Examples of org.exolab.jms.common.threads.ThreadFactory

     *                    threads
     */
    public ThreadPool(ThreadGroup group, String name, Channel channel,
                      int maxPoolSize, boolean daemon) {
        super(channel, maxPoolSize);
        setThreadFactory(new ThreadFactory(group, name + "-Worker-", daemon));
    }
View Full Code Here

Examples of org.jgroups.util.ThreadFactory

        Map<String,Object> m=channel.getInfo();
        min_threads=Global.getPropertyAsInteger(Global.MUX_MIN_THREADS, min_threads);
        max_threads=Global.getPropertyAsInteger(Global.MUX_MAX_THREADS, max_threads);
        keep_alive=Global.getPropertyAsLong(Global.MUX_KEEPALIVE, keep_alive);

        ThreadFactory factory=new DefaultThreadFactory(Util.getGlobalThreadGroup(), "Multiplexer", false, true);
        return new ThreadPoolExecutor(min_threads, max_threads, keep_alive, TimeUnit.MILLISECONDS,
                                      new SynchronousQueue<Runnable>(),
                                      factory,
                                      new ShutdownRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.