@Override public ObjectStore<Serializable> getObjectStore() { return new SimpleMemoryObjectStore<>(); }
@Override public ObjectStore<Serializable> getObjectStore() { return new SimpleMemoryObjectStore<>(); }
@Test public void testClearPartition() throws ObjectStoreException, InterruptedException, RegistrationException { getRegistry().registerObject(BASE_IN_MEMORY_OBJECT_STORE_KEY, new SimpleMemoryObjectStore<String>()); ObjectStoreManager manager = getRegistry().lookupObject(OBJECT_STORE_MANAGER); ObjectStore<String> partition1 = manager.createObjectStore("inMemoryPart1", unmanagedTransient()); ObjectStore<String> partition2 = manager.createObjectStore("inMemoryPart2", unmanagedTransient()); partition1.store("key1", "value1"); partition2.store("key2", "value2"); assertEquals("value1", partition1.retrieve("key1")); assertEquals("value2", partition2.retrieve("key2")); partition1.clear(); assertEquals("value2", partition2.retrieve("key2")); }
@Test public void testInMemoryStore() throws ObjectStoreException, InterruptedException, RegistrationException { getRegistry().registerObject(BASE_IN_MEMORY_OBJECT_STORE_KEY, new SimpleMemoryObjectStore<String>()); ObjectStoreManager manager = getRegistry().lookupObject(OBJECT_STORE_MANAGER); ObjectStore<String> store = manager.createObjectStore("inMemoryPart1", unmanagedTransient()); testObjectStore(store); testObjectStoreExpiry(manager, "inMemoryExpPart1", ObjectStoreSettings.builder() .persistent(false) .entryTtl(500L) .expirationInterval(200L) .build()); testObjectStoreMaxEntries(manager, "inMemoryMaxPart1", ObjectStoreSettings.builder() .persistent(false) .maxEntries(10) .entryTtl(10000L) .expirationInterval(200L) .build()); }
private RelaxedAsyncReplyMP(MuleContext muleContext) throws MuleException { store = new SimpleMemoryObjectStore<>(); name = "asyncReply"; setMuleContext(muleContext); start(); }
@Test public void testClearPartition() throws ObjectStoreException, InterruptedException, RegistrationException { getRegistry().registerObject(BASE_IN_MEMORY_OBJECT_STORE_KEY, new SimpleMemoryObjectStore<String>()); ObjectStoreManager manager = getRegistry().lookupObject(OBJECT_STORE_MANAGER); ObjectStore<String> partition1 = manager.createObjectStore("inMemoryPart1", unmanagedTransient()); ObjectStore<String> partition2 = manager.createObjectStore("inMemoryPart2", unmanagedTransient()); partition1.store("key1", "value1"); partition2.store("key2", "value2"); assertEquals("value1", partition1.retrieve("key1")); assertEquals("value2", partition2.retrieve("key2")); partition1.clear(); assertEquals("value2", partition2.retrieve("key2")); }
@Test public void testInMemoryStore() throws ObjectStoreException, InterruptedException, RegistrationException { getRegistry().registerObject(BASE_IN_MEMORY_OBJECT_STORE_KEY, new SimpleMemoryObjectStore<String>()); ObjectStoreManager manager = getRegistry().lookupObject(OBJECT_STORE_MANAGER); ObjectStore<String> store = manager.createObjectStore("inMemoryPart1", unmanagedTransient()); testObjectStore(store); testObjectStoreExpiry(manager, "inMemoryExpPart1", ObjectStoreSettings.builder() .persistent(false) .entryTtl(500L) .expirationInterval(200L) .build()); testObjectStoreMaxEntries(manager, "inMemoryMaxPart1", ObjectStoreSettings.builder() .persistent(false) .maxEntries(10) .entryTtl(10000L) .expirationInterval(200L) .build()); }