Package org.mule.api.store

Examples of org.mule.api.store.ObjectStoreManager


    private synchronized ObjectStore<Boolean> getRefreshedTokens()
    {
        if (this.refreshedTokens == null)
        {
            ObjectStoreManager osManager = this.muleContext.getObjectStoreManager();
            this.refreshedTokens = osManager.getObjectStore("RefreshTokenStore", false, UNBOUNDED,
                                                            this.minRefreshInterval, this.minRefreshInterval);
        }
        return this.refreshedTokens;
    }
View Full Code Here


    @Test
    public void testInMemoryStore() throws ObjectStoreException, InterruptedException, RegistrationException
    {
        muleContext.getRegistry().registerObject(MuleProperties.OBJECT_STORE_DEFAULT_IN_MEMORY_NAME,
            new SimpleMemoryObjectStore<String>());
        ObjectStoreManager manager = muleContext.getRegistry().lookupObject(
            MuleProperties.OBJECT_STORE_MANAGER);
        ListableObjectStore<String> store = manager.getObjectStore("inMemoryPart1", false);
        assertTrue(store instanceof PartitionedObjectStoreWrapper);
        ObjectStore<String> baseStore = ((PartitionedObjectStoreWrapper<String>) store).getBaseStore();
        assertTrue(baseStore instanceof SimpleMemoryObjectStore);
        assertSame(baseStore,
            muleContext.getRegistry().lookupObject(MuleProperties.OBJECT_STORE_DEFAULT_IN_MEMORY_NAME));
        testObjectStore(store);
        testObjectStoreExpiry(manager.<ObjectStore<String>> getObjectStore("inMemoryExpPart1", false, -1,
            500, 200));
        testObjectStoreMaxEntries(manager.<ListableObjectStore<String>> getObjectStore("inMemoryMaxPart1",
            false, 10, 10000, 200));
    }
View Full Code Here

    @Test
    public void testClearPartition() throws ObjectStoreException, InterruptedException, RegistrationException
    {
        muleContext.getRegistry().registerObject(MuleProperties.OBJECT_STORE_DEFAULT_IN_MEMORY_NAME,
            new SimpleMemoryObjectStore<String>());
        ObjectStoreManager manager = muleContext.getRegistry().lookupObject(
            MuleProperties.OBJECT_STORE_MANAGER);
       
       
        ObjectStore<String> partition1 = manager.getObjectStore("inMemoryPart1", false);
        ObjectStore<String> partition2 = manager.getObjectStore("inMemoryPart2", false);
       
        partition1.store("key1", "value1");
        partition2.store("key2", "value2");
       
        assertEquals("value1", partition1.retrieve("key1"));
View Full Code Here

    {
        QueuePersistenceObjectStore<String> queueStore = new QueuePersistenceObjectStore<String>(muleContext);
        queueStore.open();
        muleContext.getRegistry().registerObject(MuleProperties.OBJECT_STORE_DEFAULT_PERSISTENT_NAME,
            queueStore);
        ObjectStoreManager manager = muleContext.getRegistry().lookupObject(
            MuleProperties.OBJECT_STORE_MANAGER);
        ListableObjectStore<String> store = manager.getObjectStore("persistencePart1", true);
        assertTrue(store instanceof PartitionedObjectStoreWrapper);
        ObjectStore<String> baseStore = ((PartitionedObjectStoreWrapper<String>) store).getBaseStore();
        assertTrue(baseStore instanceof QueuePersistenceObjectStore);
        assertSame(baseStore,
            muleContext.getRegistry().lookupObject(MuleProperties.OBJECT_STORE_DEFAULT_PERSISTENT_NAME));
        testObjectStore(store);
        testObjectStoreExpiry(manager.<ObjectStore<String>> getObjectStore("persistenceExpPart1", true, -1,
            500, 200));
        testObjectStoreMaxEntries(manager.<ListableObjectStore<String>> getObjectStore("persistenceMaxPart1",
            true, 10, 10000, 200));
    }
View Full Code Here

    public void testPartitionableInMemoryStore()
        throws ObjectStoreException, RegistrationException, InterruptedException
    {
        muleContext.getRegistry().registerObject(MuleProperties.OBJECT_STORE_DEFAULT_IN_MEMORY_NAME,
            new PartitionedInMemoryObjectStore<String>());
        ObjectStoreManager manager = muleContext.getRegistry().lookupObject(
            MuleProperties.OBJECT_STORE_MANAGER);
        ListableObjectStore<String> store = manager.getObjectStore("inMemoryPart2", false);
        assertTrue(store instanceof ObjectStorePartition);
        ObjectStore<String> baseStore = ((ObjectStorePartition<String>) store).getBaseStore();
        assertTrue(baseStore instanceof PartitionedInMemoryObjectStore);
        assertSame(baseStore,
            muleContext.getRegistry().lookupObject(MuleProperties.OBJECT_STORE_DEFAULT_IN_MEMORY_NAME));
        testObjectStore(store);
        testObjectStoreExpiry(manager.<ObjectStore<String>> getObjectStore("inMemoryExpPart2", false, -1,
            500, 200));
        testObjectStoreMaxEntries(manager.<ListableObjectStore<String>> getObjectStore("inMemoryMaxPart2",
            false, 10, 10000, 200));
    }
View Full Code Here

        PartitionedPersistentObjectStore<String> partitionedStore = new PartitionedPersistentObjectStore<String>(
            muleContext);
        partitionedStore.open();
        muleContext.getRegistry().registerObject(MuleProperties.OBJECT_STORE_DEFAULT_PERSISTENT_NAME,
            partitionedStore);
        ObjectStoreManager manager = muleContext.getRegistry().lookupObject(
            MuleProperties.OBJECT_STORE_MANAGER);
        ListableObjectStore<String> store = manager.getObjectStore("persistencePart2", true);
        assertTrue(store instanceof ObjectStorePartition);
        ObjectStore<String> baseStore = ((ObjectStorePartition<String>) store).getBaseStore();
        assertTrue(baseStore instanceof PartitionedPersistentObjectStore);
        assertSame(baseStore,
            muleContext.getRegistry().lookupObject(MuleProperties.OBJECT_STORE_DEFAULT_PERSISTENT_NAME));
        testObjectStore(store);
        testObjectStoreExpiry(manager.<ObjectStore<String>> getObjectStore("persistenceExpPart2", true, -1,
            1000, 200));
        testObjectStoreMaxEntries(manager.<ListableObjectStore<String>> getObjectStore("persistenceMaxPart2",
            true, 10, 10000, 200));
    }
View Full Code Here

    private ListableObjectStore<T> getStore()
    {
        if (store == null)
        {
            ObjectStoreManager objectStoreManager = (ObjectStoreManager) context.getRegistry().lookupObject(
                MuleProperties.OBJECT_STORE_MANAGER);
            if (objectStoreManager == null)
            {
                return null;
            }
            if (maxEntries != 0)
            {
                store = (ListableObjectStore<T>) objectStoreManager.getObjectStore(storeName, isPersistent,
                    maxEntries, entryTTL, expirationInterval);
            }
            else
            {
                store = (ListableObjectStore<T>) objectStoreManager.getObjectStore(storeName, isPersistent);
            }
        }
        return store;
    }
View Full Code Here

        });
    }

    private ObjectStore<Serializable> getDefaultObjectStore()
    {
        ObjectStoreManager mgr = (ObjectStoreManager) muleContext.getRegistry().get(
            MuleProperties.OBJECT_STORE_MANAGER);
        return mgr.getObjectStore(WatermarkFactoryBean.MULE_WATERMARK_PARTITION);
    }
View Full Code Here

        store = createStore();
    }

    private ObjectStore<AtomicInteger> createStore() throws InitialisationException
    {
        ObjectStoreManager objectStoreManager = (ObjectStoreManager) muleContext.getRegistry().get(
                                MuleProperties.OBJECT_STORE_MANAGER);
        return objectStoreManager.getObjectStore(flowConstruct.getName() + "." + getClass().getName(), false, -160 * 5 * 1000, 6000 );
    }
View Full Code Here

        if (getFlowConstruct() instanceof Flow)
        {
            synchronousProcessing = ((Flow)getFlowConstruct()).getProcessingStrategy() instanceof SynchronousProcessingStrategy;
        }
        this.poolOnPrimaryInstanceOnly = Boolean.valueOf(System.getProperty(MULE_TRANSPORT_FILE_SINGLEPOLLINSTANCE,"false")) || !synchronousProcessing;
        ObjectStoreManager objectStoreManager = getEndpoint().getMuleContext().getRegistry().get(MuleProperties.OBJECT_STORE_MANAGER);
        filesBeingProcessingObjectStore = objectStoreManager.getObjectStore(getEndpoint().getName(),false,1000,60000,20000);
    }
View Full Code Here

TOP

Related Classes of org.mule.api.store.ObjectStoreManager

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.