Package com.hazelcast.core

Examples of com.hazelcast.core.QueueStore


        HazelcastInstance instance = createHazelcastInstance(config);

        final IQueue<Integer> queue = instance.getQueue(queueName);
        queue.add(1);

        final QueueStore queueStore = queueStoreFactory.newQueueStore(queueName, null);
        final TestQueueStore testQueueStore = (TestQueueStore) queueStore;
        final int size = testQueueStore.store.size();

        assertEquals("Queue store size should be 1 but found " + size, 1, size);
    }
View Full Code Here


        HazelcastInstance instance = createHazelcastInstance(config);

        final IQueue<Integer> queue = instance.getQueue(queueName);
        queue.add(1);

        final QueueStore queueStore = queueStoreFactory.newQueueStore(queueName, null);
        final TestQueueStore testQueueStore = (TestQueueStore) queueStore;
        final int size = testQueueStore.store.size();

        assertEquals("Expected not queue store operation" +
                " since we disabled it in QueueStoreConfig but found initialized ", 0, size);
View Full Code Here

        if (storeConfig == null || !storeConfig.isEnabled()) {
            return storeWrapper;
        }
        // create queue store.
        final ClassLoader classLoader = serializationService.getClassLoader();
        final QueueStore queueStore = createQueueStore(name, storeConfig, classLoader);
        if (queueStore != null) {
            storeWrapper.setEnabled(storeConfig.isEnabled());
            storeWrapper.setBinary(Boolean.parseBoolean(storeConfig.getProperty(STORE_BINARY)));
            storeWrapper.setMemoryLimit(parseInt(STORE_MEMORY_LIMIT, DEFAULT_MEMORY_LIMIT, storeConfig));
            storeWrapper.setBulkLoad(parseInt(STORE_BULK_LOAD, DEFAULT_BULK_LOAD, storeConfig));
View Full Code Here

        return storeWrapper;
    }

    private static QueueStore createQueueStore(String name, QueueStoreConfig storeConfig, ClassLoader classLoader) {
        // 1. Try to create store from `store impl.` class.
        QueueStore store = getQueueStore(storeConfig, classLoader);
        // 2. Try to create store from `store factory impl.` class.
        if (store == null) {
            store = getQueueStoreFactory(name, storeConfig, classLoader);
        }
        return store;
View Full Code Here

    private static QueueStore getQueueStore(QueueStoreConfig storeConfig, ClassLoader classLoader) {
        if (storeConfig == null) {
            return null;
        }
        QueueStore store = storeConfig.getStoreImplementation();
        if (store != null) {
            return store;
        }
        try {
            store = ClassLoaderUtil.newInstance(classLoader, storeConfig.getClassName());
View Full Code Here

TOP

Related Classes of com.hazelcast.core.QueueStore

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.