Package com.sun.sgs.impl.util

Examples of com.sun.sgs.impl.util.NamedThreadFactory


        // NOTE: this is replicating previous behavior where there is a
        // fixed-size pool for running tasks, but in practice we may
        // want a flexible pool that allows (e.g.) for tasks that run
        // for the lifetime of a stack
        this.executor = Executors.newScheduledThreadPool(
                requestedThreads, new NamedThreadFactory("TaskScheduler"));

        logger.log(Level.CONFIG,
                   "Created TaskSchedulerImpl with properties:" +
                   "\n  " + CONSUMER_THREADS_PROPERTY + "=" + requestedThreads);
    }
View Full Code Here


            AsynchronousChannelProvider provider =
                AsynchronousChannelProvider.provider();
            asyncChannelGroup =
                provider.openAsynchronousChannelGroup(
                    Executors.newCachedThreadPool(
                    new NamedThreadFactory("TcpTransport-Acceptor")));
            acceptor =
                provider.openAsynchronousServerSocketChannel(asyncChannelGroup);
      try {
                acceptor.bind(listenAddress, acceptorBacklog);
    if (logger.isLoggable(Level.CONFIG)) {
View Full Code Here

        PropertiesWrapper wrappedProps = new PropertiesWrapper(properties);
        numThreads = wrappedProps.getIntProperty(
            NUM_THREADS_PROPERTY, DEFAULT_NUM_THREADS, 1, 65535);
        if (numThreads > 1) {
            executor = Executors.newFixedThreadPool(numThreads,
                    new NamedThreadFactory("LPA"));
        } else {
            executor = null;
        }
        logger.log(Level.CONFIG,
                       "Creating LPA with properties:" +
View Full Code Here

      logger.log(Level.INFO, "Server is using port {0,number,#}", port);
  }
  long reapDelay = wrappedProps.getLongProperty(
      REAP_DELAY_PROPERTY, DEFAULT_REAP_DELAY);
  executor = Executors.newSingleThreadScheduledExecutor(
                new NamedThreadFactory("DataStoreServer-TransactionReaper"));
  executor.scheduleAtFixedRate(
      new Runnable() {
    public void run() {
        try {
      reapExpiredTransactions();
View Full Code Here

        // scheduler starts trying to add or drop consumers adaptively
        this.requestedThreads =
            Integer.parseInt(properties.getProperty(CONSUMER_THREADS_PROPERTY,
                                                    DEFAULT_CONSUMER_THREADS));
        this.executor = Executors.newCachedThreadPool(
                new NamedThreadFactory("TransactionScheduler"));
        for (int i = 0; i < requestedThreads; i++) {
            executor.submit(new TaskConsumer());
        }

        // initialize the default timeout for scheduled tasks
View Full Code Here

    this, maxRetry, retryWait);
      serverPort = serverExporter.export(
    new LoggingCachingDataStoreServer(this, logger),
    "CachingDataStoreServer", requestedServerPort);
      callbackExecutor = Executors.newCachedThreadPool(
    new NamedThreadFactory(CLASSNAME + ".callback-"));
      for (int i = 0; i < numCallbackThreads; i++) {
    callbackExecutor.execute(new CallbackRequester());
      }
  } catch (IOException e) {
      if (logger.isLoggable(WARNING)) {
View Full Code Here

      logger.log(Level.INFO, "Server is using port {0,number,#}", port);
  }
  long reapDelay = wrappedProps.getLongProperty(
      REAP_DELAY_PROPERTY, DEFAULT_REAP_DELAY);
  executor = Executors.newSingleThreadScheduledExecutor(
                new NamedThreadFactory("DataStoreServer-TransactionReaper"));
  executor.scheduleAtFixedRate(
      new Runnable() {
    public void run() {
        try {
      reapExpiredTransactions();
View Full Code Here

        // scheduler starts trying to add or drop consumers adaptively
        this.requestedThreads =
            Integer.parseInt(properties.getProperty(CONSUMER_THREADS_PROPERTY,
                                                    DEFAULT_CONSUMER_THREADS));
        this.executor = Executors.newCachedThreadPool(
                new NamedThreadFactory("TransactionScheduler"));
        for (int i = 0; i < requestedThreads; i++) {
            executor.submit(new TaskConsumer());
        }

        // initialize the default timeout for scheduled tasks
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.util.NamedThreadFactory

Copyright © 2018 www.massapicom. 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.