Package jersey.repackaged.com.google.common.util.concurrent

Examples of jersey.repackaged.com.google.common.util.concurrent.ThreadFactoryBuilder


                    if (poolSize <= 0) {
                        LOGGER.config(LocalizationMessages.IGNORED_ASYNC_THREADPOOL_SIZE(poolSize));
                    }
                }

                final ThreadFactory threadFactory = new ThreadFactoryBuilder()
                        .setNameFormat("jersey-client-async-executor-%d")
                        .build();

                if (poolSize > 0) {
                    LOGGER.config(LocalizationMessages.USING_FIXED_ASYNC_THREADPOOL(poolSize));
View Full Code Here


        return new RequestExecutorProvider() {

            @Override
            public ExecutorService getRequestingExecutor() {
                return Executors.newCachedThreadPool(
                        new ThreadFactoryBuilder().setNameFormat("jersey-server-managed-async-executor-%d").build());
            }

            @Override
            public void releaseRequestingExecutor(ExecutorService executor) {
                executor.shutdownNow();
View Full Code Here

        public BackgroundSchedulerFactory(@Optional RuntimeThreadProvider rtp) {
            if (rtp == null) {
                rtp = new RuntimeThreadProvider() {
                    @Override
                    public ThreadFactory getRequestThreadFactory() {
                        return new ThreadFactoryBuilder()
                                .setNameFormat("jersey-request-specific-task-thread-%d")
                                .build();
                    }

                    @Override
                    public ThreadFactory getBackgroundThreadFactory() {
                        return new ThreadFactoryBuilder()
                                .setNameFormat("jersey-background-task-thread-%d")
                                .build();
                    }
                };
            }
View Full Code Here

            this.runtimeThreadProvider = rtp;
        }

        @Override
        public ScheduledExecutorService provide() {
            final ThreadFactory threadFactory = new ThreadFactoryBuilder()
                    .setNameFormat("jersey-background-task-scheduler-%d")
                    .setThreadFactory(runtimeThreadProvider.getBackgroundThreadFactory())
                    .build();

            return new ScheduledThreadPoolExecutor(1, threadFactory, new RejectedExecutionHandler() {
View Full Code Here

    private ExecutorService executor;

    @Before
    public void setUp() throws Exception {
        client = ClientBuilder.newClient().register(TerminalClientRequestFilter.class);
        executor = new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat("jersey-rx-client-test-%d").build());
    }
View Full Code Here

    private ExecutorService executor;

    @Before
    public void setUp() throws Exception {
        client = ClientBuilder.newClient().register(TerminalClientRequestFilter.class);
        executor = new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat("jersey-rx-client-test-%d").build());
    }
View Full Code Here

    }

    @Test
    public void testRxCustomExecutor() throws Exception {
        final ExecutorService executor = new ScheduledThreadPoolExecutor(1,
                new ThreadFactoryBuilder().setNameFormat("jersey-rx-client-test-%d").build());

        assertThat(rxBuilder.rx(executor).get().get().getHeaderString("Test-Thread"), containsString("jersey-rx-client-test"));
    }
View Full Code Here

    private ExecutorService executor;

    @Before
    public void setUp() throws Exception {
        client = ClientBuilder.newClient().register(TerminalClientRequestFilter.class);
        executor = new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat("jersey-rx-client-test-%d").build());
    }
View Full Code Here

    private ExecutorService executor;

    @Before
    public void setUp() throws Exception {
        executor = new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat("jersey-rx-client-test-%d").build());
    }
View Full Code Here

        final boolean debugMode = false;
        final boolean sequentialGet = false;
        final Object sequentialGetLock = new Object();

        final ExecutorService executor = Executors.newCachedThreadPool(
                new ThreadFactoryBuilder().setNameFormat("async-resource-test-%d").build());

        final Map<Integer, ResponseRecord> getResponses = new ConcurrentHashMap<Integer, ResponseRecord>();

        final CountDownLatch getRequestLatch = new CountDownLatch(MAX_MESSAGES);
View Full Code Here

TOP

Related Classes of jersey.repackaged.com.google.common.util.concurrent.ThreadFactoryBuilder

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.