Package org.jboss.threads

Examples of org.jboss.threads.JBossThreadFactory$StringAppender


        return executorService;
    }

    public void setupRemoting(final ManagementChannelInitialization initialization) throws IOException {
        //executorService = Executors.newCachedThreadPool();
        final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("Remoting"), Boolean.FALSE, null, "Remoting %f thread %t", null, null, AccessController.getContext());
        executorService = new QueueExecutor(EXECUTOR_MAX_THREADS / 4 + 1, EXECUTOR_MAX_THREADS, EXECUTOR_KEEP_ALIVE_TIME, TimeUnit.MILLISECONDS, 500, threadFactory, true, null);

        final ChannelServer.Configuration configuration = new ChannelServer.Configuration();
        configuration.setEndpointName(ENDPOINT_NAME);
        configuration.setUriScheme(URI_SCHEME);
View Full Code Here


    /** {@inheritDoc} */
    @Override
    public synchronized void start(StartContext context) throws StartException {
        final ProcessControllerClient client;
        try {
            final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("ProcessControllerConnection-thread"), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext());
            final ThreadPoolExecutor executorService = new ThreadPoolExecutor(THREAD_POOL_CORE_SIZE, THREAD_POOL_MAX_SIZE, 30L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(WORK_QUEUE_SIZE), threadFactory);

            final ProtocolClient.Configuration configuration = new ProtocolClient.Configuration();
            configuration.setReadExecutor(executorService);
            configuration.setServerAddress(new InetSocketAddress(environment.getProcessControllerAddress(), environment.getProcessControllerPort().intValue()));
View Full Code Here

    public synchronized void start(StartContext context) throws StartException {
        SERVER_MANAGEMENT_LOGGER.debugf("Starting operation handler service %s", context.getController().getName());
        if(executor.getOptionalValue() == null) {
            // Create the default executor
            final BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<Runnable>(WORK_QUEUE_SIZE);
            final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup(getThreadGroupName()), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext());
            final ThreadPoolExecutor executorService = new ThreadPoolExecutor(POOL_CORE_SIZE, POOL_MAX_SIZE,
                                                            60L, TimeUnit.SECONDS, workQueue,
                                                            threadFactory);
            // Allow the core threads to time out as well
            executorService.allowCoreThreadTimeOut(true);
View Full Code Here

    public synchronized void start(StartContext context) throws StartException {
        SERVER_MANAGEMENT_LOGGER.debugf("Starting operation handler service %s", context.getController().getName());
        if(executor.getOptionalValue() == null) {
            // Create the default executor
            final BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<Runnable>(WORK_QUEUE_SIZE);
            final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup(getThreadGroupName()), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext());
            final ThreadPoolExecutor executorService = new ThreadPoolExecutor(POOL_CORE_SIZE, POOL_MAX_SIZE,
                                                            60L, TimeUnit.SECONDS, workQueue,
                                                            threadFactory);
            // Allow the core threads to time out as well
            executorService.allowCoreThreadTimeOut(true);
View Full Code Here

    private static final String ENDPOINT_NAME = "mgmt-endpoint";

    private static final AtomicInteger executorCount = new AtomicInteger();
    static ExecutorService createDefaultExecutor() {
        final ThreadGroup group = new ThreadGroup("mgmt-client-thread");
        final ThreadFactory threadFactory = new JBossThreadFactory(group, Boolean.FALSE, null, "%G " + executorCount.incrementAndGet() + "-%t", null, null, AccessController.getContext());
        return new ThreadPoolExecutor(4, 4, 30L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(256), threadFactory);
    }
View Full Code Here

            configuration.setBindAddress(new InetSocketAddress(bindPort));
        }
        // todo better config
        configuration.setBindAddress(new InetSocketAddress(InetAddress.getLocalHost(), 0));
        configuration.setSocketFactory(ServerSocketFactory.getDefault());
        final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("ProcessController-threads"), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext());
        configuration.setThreadFactory(threadFactory);
        configuration.setReadExecutor(Executors.newCachedThreadPool(threadFactory));

        final ProcessController processController = new ProcessController(configuration, System.out, System.err);
        final InetSocketAddress boundAddress = processController.getServer().getBoundAddress();
View Full Code Here

        }

        final ProtocolServer.Configuration configuration = new ProtocolServer.Configuration();
        configuration.setBindAddress(new InetSocketAddress(pcSocketConfig.getBindAddress(), pcSocketConfig.getBindPort()));
        configuration.setSocketFactory(ServerSocketFactory.getDefault());
        final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("ProcessController-threads"), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext());
        configuration.setThreadFactory(threadFactory);
        configuration.setReadExecutor(Executors.newCachedThreadPool(threadFactory));

        final ProcessController processController = new ProcessController(configuration, System.out, System.err);
        final InetSocketAddress boundAddress = processController.getServer().getBoundAddress();
View Full Code Here

        this.namePattern = namePattern;
    }

    public synchronized void start(final StartContext context) throws StartException {
        final ThreadGroup threadGroup = new ThreadGroup(threadGroupName);
        value = new JBossThreadFactory(threadGroup, Boolean.FALSE, priority, namePattern, null, null, AccessController.getContext());
    }
View Full Code Here

public class ClientConfigurationImpl implements ModelControllerClientConfiguration {

    private static final int DEFAULT_MAX_THREADS = getSystemProperty("org.jboss.as.controller.client.max-threads", 6);

    static ExecutorService createDefaultExecutor() {
        final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("management-client-threads"), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext());
        return new ThreadPoolExecutor(2, DEFAULT_MAX_THREADS, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory);
    }
View Full Code Here

    private void initializeExecutorService(ServerEnvironment serverEnvironment) {
        if (serverEnvironment.isAllowModelControllerExecutor()) {
            final ThreadGroup threadGroup = new ThreadGroup("ModelController ThreadGroup");
            final String namePattern = "ServerService Thread Pool -- %t";
            final ThreadFactory threadFactory = new JBossThreadFactory(threadGroup, Boolean.FALSE, null, namePattern, null, null, AccessController.getContext());
            queuelessExecutor = new ThreadPoolExecutor(0, Integer.MAX_VALUE,
                                      5L, TimeUnit.SECONDS,
                                      new SynchronousQueue<Runnable>(),
                                      threadFactory);
            getExecutorServiceInjector().inject(queuelessExecutor);
View Full Code Here

TOP

Related Classes of org.jboss.threads.JBossThreadFactory$StringAppender

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.