Examples of LoggingThreadFactory


Examples of org.cspoker.common.util.threading.LoggingThreadFactory

  public XmlHttpSerializer(URL url, final String username, final String password) {
    authorizationString = "Basic "
      + Base64.encode((username + ":" + password).getBytes(), 0);
    this.url = url;
    scheduler = Executors.newSingleThreadScheduledExecutor(new LoggingThreadFactory("http"));
    synchronized (pollerLock) {
      poller = new DummyScheduledFuture<Object>();
    }
  }
View Full Code Here

Examples of org.restlet.engine.log.LoggingThreadFactory

     * Creates the connector controller service.
     *
     * @return The connector controller service.
     */
    protected ExecutorService createControllerService() {
        return Executors.newSingleThreadExecutor(new LoggingThreadFactory(
                getLogger(), isControllerDaemon()));
    }
View Full Code Here

Examples of org.restlet.engine.log.LoggingThreadFactory

            queue = new ArrayBlockingQueue<Runnable>(getMaxQueued());
        }

        ThreadPoolExecutor result = new ThreadPoolExecutor(minThreads,
                maxThreads, getMaxThreadIdleTimeMs(), TimeUnit.MILLISECONDS,
                queue, new LoggingThreadFactory(getLogger(), true));
        result.setRejectedExecutionHandler(new RejectedExecutionHandler() {
            public void rejectedExecution(Runnable r,
                    ThreadPoolExecutor executor) {
                getLogger().warning(
                        "Unable to run the following "
View Full Code Here

Examples of org.rhq.core.pc.util.LoggingThreadFactory

        this.configuration = configuration;
        timer = new Timer(SENDER_THREAD_POOL_NAME + ".timeout-timer");

        // read the javadoc on ThreadPoolExecutor and how max pool size is affected when using LinkedBlockingQueue
        LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(10000);
        LoggingThreadFactory threadFactory = new LoggingThreadFactory(SENDER_THREAD_POOL_NAME, true);
        int maxPoolSize = configuration.getOperationInvokerThreadPoolSize();
        ThreadPoolExecutor threadPool = new ThreadPoolExecutor(maxPoolSize, maxPoolSize, 1000, TimeUnit.MILLISECONDS,
            queue, threadFactory);
        operationGateway = new OperationThreadPoolGateway(threadPool);
    }
View Full Code Here

Examples of org.rhq.core.pc.util.LoggingThreadFactory

            //discoveries.
            activateAndUpgradeResources();

            // Never run more than one avail check at a time.
            availabilityThreadPoolExecutor = new ScheduledThreadPoolExecutor(AVAIL_THREAD_POOL_CORE_POOL_SIZE,
                new LoggingThreadFactory(AVAIL_THREAD_POOL_NAME, true));

            // Never run more than one discovery scan at a time (service and service scans share the same pool).
            inventoryThreadPoolExecutor = new ScheduledThreadPoolExecutor(1, new LoggingThreadFactory(
                INVENTORY_THREAD_POOL_NAME, true));

            // Only schedule periodic discovery scans and avail checks if we are running inside the RHQ Agent (versus
            // inside EmbJopr).
            if (configuration.isInsideAgent()) {
View Full Code Here

Examples of org.rhq.core.pc.util.LoggingThreadFactory

                    latch.allowAllCommands(m_commServices);

                    // Now that we are allowing commands to be passed back and forth with the server and
                    // the PC is likely up, start our Ping service
                    m_pingThreadPoolExecutor = new ScheduledThreadPoolExecutor(PING_THREAD_POOL_CORE_POOL_SIZE,
                        new LoggingThreadFactory(PING_THREAD_POOL_NAME, true));
                    long pingInterval = m_configuration.getClientSenderServerPollingInterval();
                    pingInterval = (pingInterval < PING_INTERVAL_MINIMUM) ? PING_INTERVAL_MINIMUM : pingInterval;
                    m_pingThreadPoolExecutor.scheduleWithFixedDelay(new PingExecutor(), 0L, pingInterval,
                        TimeUnit.MILLISECONDS);
View Full Code Here

Examples of org.rhq.core.pc.util.LoggingThreadFactory

     * Initialize the ResourceContainer's internals, such as its thread pools.
     *
     * @param pcConfig the plugin container's configuration
     */
    public static void initialize(PluginContainerConfiguration pcConfig) {
        LoggingThreadFactory daemonFactory = new LoggingThreadFactory(DAEMON_THREAD_POOL_NAME, true);
        LoggingThreadFactory nonDaemonFactory = new LoggingThreadFactory(NON_DAEMON_THREAD_POOL_NAME, false);
        LoggingThreadFactory availCheckFactory = new LoggingThreadFactory(AVAIL_CHECK_THREAD_POOL_NAME, true);
        DAEMON_THREAD_POOL = Executors.newCachedThreadPool(daemonFactory);
        NON_DAEMON_THREAD_POOL = Executors.newCachedThreadPool(nonDaemonFactory);
        AVAIL_CHECK_THREAD_POOL = Executors.newFixedThreadPool(pcConfig.getAvailabilityScanThreadPoolSize(),
            availCheckFactory);
    }
View Full Code Here

Examples of org.rhq.core.pc.util.LoggingThreadFactory

        this.configuration = configuration;
        this.inventoryManager = inventoryManager;

        if (configuration.isInsideAgent()) {
            int threadPoolSize = configuration.getMeasurementCollectionThreadPoolSize();
            collectorThreadPool = new ScheduledThreadPoolExecutor(threadPoolSize, new LoggingThreadFactory(
                COLLECTOR_THREAD_POOL_NAME, true));
            senderThreadPool = new ScheduledThreadPoolExecutor(2, new LoggingThreadFactory(SENDER_THREAD_POOL_NAME,
                true));
            measurementSenderRunner = new MeasurementSenderRunner(this);
            measurementCollectorRunner = new MeasurementCollectorRunner(this);
        } else {
            senderThreadPool = null;
View Full Code Here

Examples of org.rhq.core.pc.util.LoggingThreadFactory

    public BundleManager(PluginContainerConfiguration configuration, AgentServiceStreamRemoter streamRemoter,
        InventoryManager inventoryManager, MeasurementManager measurementManager) {
        super(BundleAgentService.class, streamRemoter);
        this.configuration = configuration;
        LoggingThreadFactory threadFactory = new LoggingThreadFactory("BundleDeployment", true);
        this.deployerThreadPool = Executors.newSingleThreadExecutor(threadFactory); // single-threaded so only one deployment at a time
        this.inventoryManager = inventoryManager;
        this.measurementManager = measurementManager;
    }
View Full Code Here

Examples of org.rhq.core.pc.util.LoggingThreadFactory

        ConfigManagementFactory factory, AgentServiceStreamRemoter streamRemoter, InventoryManager inventoryManager) {
        super(ConfigurationAgentService.class, streamRemoter);
        this.componentService = componentService;
        configMgmtFactory = factory;
        pluginContainerConfiguration = configuration;
        LoggingThreadFactory threadFactory = new LoggingThreadFactory(SENDER_THREAD_POOL_NAME, true);
        threadPool = new ScheduledThreadPoolExecutor(1, threadFactory);

        if (pluginContainerConfiguration.getConfigurationDiscoveryInterval() > 0
            && pluginContainerConfiguration.getConfigurationDiscoveryPeriod() > 0
            && pluginContainerConfiguration.isInsideAgent()) {
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.