Examples of addExecutorConfig()


Examples of com.hazelcast.config.Config.addExecutorConfig()

        } catch (FileNotFoundException e) {
            config = new Config();
        }

        for (int k = 1; k <= LOAD_EXECUTORS_COUNT; k++) {
            config.addExecutorConfig(new ExecutorConfig("e" + k).setPoolSize(k));
        }
        TestApp testApp = new TestApp(Hazelcast.newHazelcastInstance(config));
        testApp.start(args);
    }
View Full Code Here

Examples of com.hazelcast.config.Config.addExecutorConfig()

        } catch (FileNotFoundException e) {
            config = new Config();
        }

        for (int k = 1; k <= LOAD_EXECUTORS_COUNT; k++) {
            config.addExecutorConfig(new ExecutorConfig("e" + k).setPoolSize(k));
        }
        ConsoleApp consoleApp = new ConsoleApp(Hazelcast.newHazelcastInstance(null));
        consoleApp.start(args);
    }
View Full Code Here

Examples of com.hazelcast.config.Config.addExecutorConfig()

        return createSingleNodeExecutorService(name, ExecutorConfig.DEFAULT_POOL_SIZE);
    }

    private IExecutorService createSingleNodeExecutorService(String name, int poolSize) {
        final Config config = new Config();
        config.addExecutorConfig(new ExecutorConfig(name, poolSize));
        final HazelcastInstance instance = createHazelcastInstance(config);
        return instance.getExecutorService(name);
    }

    @Test(expected = RejectedExecutionException.class)
View Full Code Here

Examples of com.hazelcast.config.Config.addExecutorConfig()

    }

    @Test
    public void testManagedContextAndLocal() throws Exception {
        final Config config = new Config();
        config.addExecutorConfig(new ExecutorConfig("test", 1));
        final AtomicBoolean initialized = new AtomicBoolean();
        config.setManagedContext(new ManagedContext() {
            @Override
            public Object initialize(Object obj) {
                if (obj instanceof RunnableWithManagedContext) {
View Full Code Here

Examples of com.hazelcast.config.Config.addExecutorConfig()

    }

    @Test
    public void hazelcastInstanceAwareAndLocal() throws Exception {
        final Config config = new Config();
        config.addExecutorConfig(new ExecutorConfig("test", 1));
        final HazelcastInstance instance = createHazelcastInstance(config);
        IExecutorService executor = instance.getExecutorService("test");

        HazelcastInstanceAwareRunnable task = new HazelcastInstanceAwareRunnable();
        // if 'setHazelcastInstance' not called we expect a RuntimeException
View Full Code Here

Examples of com.hazelcast.config.Config.addExecutorConfig()

    @Test
    public void testStatsIssue2039() throws InterruptedException, ExecutionException, TimeoutException {
        final Config config = new Config();
        final String name = "testStatsIssue2039";
        config.addExecutorConfig(new ExecutorConfig(name).setQueueCapacity(1).setPoolSize(1));
        final HazelcastInstance instance = createHazelcastInstance(config);
        final IExecutorService executorService = instance.getExecutorService(name);


        executorService.execute(new SleepLatchRunnable());
View Full Code Here

Examples of com.hazelcast.config.Config.addExecutorConfig()

        } catch (FileNotFoundException e) {
            config = new Config();
        }

        for (int k = 1; k <= LOAD_EXECUTORS_COUNT; k++) {
            config.addExecutorConfig(new ExecutorConfig("e" + k).setPoolSize(k));
        }
        ConsoleApp consoleApp = new ConsoleApp(Hazelcast.newHazelcastInstance(config));
        consoleApp.start(args);
    }
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.