Package org.rhq.core.pc.util

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


            //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

                    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

     * 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

        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

    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

        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

        int corePoolSize = configuration.getResourceFactoryCoreThreadPoolSize();
        int keepAliveTime = configuration.getResourceFactoryKeepAliveTime();
        int maxPoolSize = configuration.getResourceFactoryMaxThreadPoolSize();

        executor = new ThreadPoolExecutor(corePoolSize, maxPoolSize, keepAliveTime, TimeUnit.MILLISECONDS,
            new LinkedBlockingQueue<Runnable>(10000), new LoggingThreadFactory("ResourceFactory.executor", true));
    }
View Full Code Here

        scheduledDiscoveriesEnabled = (configuration.getContentDiscoveryPeriod() > 0);

        // Create thread pool executor. Used in both scheduled and non-scheduled mode for all discoveries.
        int threadPoolSize = configuration.getContentDiscoveryThreadPoolSize();

        discoveryThreadPoolExecutor = new ScheduledThreadPoolExecutor(threadPoolSize, new LoggingThreadFactory(
            "Content.discovery", true));
        discoveryThreadPoolExecutor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
        discoveryThreadPoolExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);

        crudExecutor = new ThreadPoolExecutor(1, 5, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(10000),
            new LoggingThreadFactory("Content.crud", true));
    }
View Full Code Here

    private SigarProxy sigar;

    public EventManager(PluginContainerConfiguration configuration) {
        pcConfig = configuration;
        activeReport = new EventReport(pcConfig.getEventReportMaxPerSource(), pcConfig.getEventReportMaxTotal());
        senderThreadPool = new ScheduledThreadPoolExecutor(SENDER_THREAD_POOL_CORE_SIZE, new LoggingThreadFactory(
            SENDER_THREAD_POOL_NAME, true));
        // Set up a thread pool for polling threads. Polling threads will be added to the pool via calls to
        // registerEventPoller().
        pollerThreadPool = new ScheduledThreadPoolExecutor(POLLER_THREAD_POOL_CORE_SIZE, new LoggingThreadFactory(
            POLLER_THREAD_POOL_NAME, true));
        pollerThreads = new HashMap<PollerKey, Runnable>();
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.pc.util.LoggingThreadFactory

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.