Package com.hazelcast.core

Examples of com.hazelcast.core.QueueStoreFactory


            } catch (Exception ignored) {
            }
        }

        if (store == null){
            QueueStoreFactory factory = storeConfig.getFactoryImplementation();
            if (factory == null){
                try {
                    factory = ClassLoaderUtil.newInstance(serializationService.getClassLoader(), storeConfig.getFactoryClassName());
                } catch (Exception ignored) {
                }
            }
            if (factory == null){
                return;
            }
            store = factory.newQueueStore(name, storeConfig.getProperties());
        }
        this.storeConfig = storeConfig;
        enabled = storeConfig.isEnabled();
        binary = Boolean.parseBoolean(storeConfig.getProperty("binary"));
        memoryLimit = parseInt("memory-limit", DEFAULT_MEMORY_LIMIT);
View Full Code Here


        }
    }

    public void factoryImpl(String name) {
        if (store == null) {
            QueueStoreFactory factory = storeConfig.getFactoryImplementation();
            if (factory == null) {
                try {
                    factory = ClassLoaderUtil.newInstance(serializationService.getClassLoader(),
                            storeConfig.getFactoryClassName());
                } catch (Exception ignored) {
                    EmptyStatement.ignore(ignored);
                }
            }
            if (factory == null) {
                return;
            }
            store = factory.newQueueStore(name, storeConfig.getProperties());
        }
    }
View Full Code Here

        final String queueName = randomString();
        final Config config = new Config();
        final QueueConfig queueConfig = config.getQueueConfig(queueName);
        final QueueStoreConfig queueStoreConfig = new QueueStoreConfig();
        queueStoreConfig.setEnabled(false);
        final QueueStoreFactory queueStoreFactory = new SimpleQueueStoreFactory();
        queueStoreConfig.setFactoryImplementation(queueStoreFactory);
        queueConfig.setQueueStoreConfig(queueStoreConfig);

        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

        final String queueName = randomString();
        final Config config = new Config();
        final QueueConfig queueConfig = config.getQueueConfig(queueName);
        final QueueStoreConfig queueStoreConfig = new QueueStoreConfig();
        queueStoreConfig.setEnabled(true);
        final QueueStoreFactory queueStoreFactory = new SimpleQueueStoreFactory();
        queueStoreConfig.setFactoryImplementation(queueStoreFactory);
        queueConfig.setQueueStoreConfig(queueStoreConfig);

        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

    private static QueueStore getQueueStoreFactory(String name, QueueStoreConfig storeConfig, ClassLoader classLoader) {
        if (storeConfig == null) {
            return null;
        }
        QueueStoreFactory factory = storeConfig.getFactoryImplementation();
        if (factory == null) {
            try {
                factory = ClassLoaderUtil.newInstance(classLoader,
                        storeConfig.getFactoryClassName());
            } catch (Exception ignored) {
                EmptyStatement.ignore(ignored);
            }
        }
        return factory == null ? null : factory.newQueueStore(name, storeConfig.getProperties());
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.QueueStoreFactory

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.