/** * Version-dependent support for generating a dummy async event queue from * the given cache and async event queue configuration. */ protected static void generateDummyAsyncEventQueue(Cache dummyCache, String asyncEventQueueConfig, String fn, Map XmlAsyncEventQueueConfigs) { AsyncEventQueueDescription aeqd = AsyncEventQueueHelper .getAsyncEventQueueDescription(asyncEventQueueConfig); Log.getLogWriter().info("Creating dummy async event queue for " + aeqd.getName()); AsyncEventQueueFactory dummyFactory = ((CacheCreation)dummyCache).createAsyncEventQueueFactory(); aeqd.configure(dummyFactory); AsyncEventQueue dummyAsyncEventQueue = dummyFactory.create(aeqd.getName(), aeqd.getAsyncEventListenerInstance()); if (Log.getLogWriter().infoEnabled()) { Log.getLogWriter().info("Added dummy async event queue: " + AsyncEventQueueHelper.asyncEventQueueToString(dummyAsyncEventQueue)); } // save the async event queue config for future reference XmlAsyncEventQueueConfigs.put(fn, asyncEventQueueConfig); }
private void endAsyncEventQueue() { AsyncEventQueueCreation asyncEventChannelCreation = (AsyncEventQueueCreation) stack.peek(); AsyncEventQueueFactory factory = cache.createAsyncEventQueueFactory(); factory.setParallel(asyncEventChannelCreation.isParallel()); factory.setBatchSize(asyncEventChannelCreation.getBatchSize()); factory.setBatchTimeInterval(asyncEventChannelCreation.getBatchTimeInterval()); factory.setBatchConflationEnabled(asyncEventChannelCreation.isBatchConflationEnabled()); factory.setPersistent(asyncEventChannelCreation.isPersistent()); factory.setDiskStoreName(asyncEventChannelCreation.getDiskStoreName()); factory.setDiskSynchronous(asyncEventChannelCreation.isDiskSynchronous()); factory.setMaximumQueueMemory(asyncEventChannelCreation.getMaximumQueueMemory()); factory.setDispatcherThreads(asyncEventChannelCreation.getDispatcherThreads()); factory.setOrderPolicy(asyncEventChannelCreation.getOrderPolicy()); AsyncEventQueue asyncEventChannel = factory.create(asyncEventChannelCreation.getId(), asyncEventChannelCreation.getAsyncEventListener()); stack.pop(); }
private void endAsyncEventQueue() { AsyncEventQueueCreation asyncEventChannelCreation = (AsyncEventQueueCreation) stack.peek(); AsyncEventQueueFactory factory = cache.createAsyncEventQueueFactory(); factory.setParallel(asyncEventChannelCreation.isParallel()); factory.setBatchSize(asyncEventChannelCreation.getBatchSize()); factory.setBatchTimeInterval(asyncEventChannelCreation.getBatchTimeInterval()); factory.setBatchConflationEnabled(asyncEventChannelCreation.isBatchConflationEnabled()); factory.setPersistent(asyncEventChannelCreation.isPersistent()); factory.setDiskStoreName(asyncEventChannelCreation.getDiskStoreName()); factory.setDiskSynchronous(asyncEventChannelCreation.isDiskSynchronous()); factory.setMaximumQueueMemory(asyncEventChannelCreation.getMaximumQueueMemory()); factory.setDispatcherThreads(asyncEventChannelCreation.getDispatcherThreads()); factory.setOrderPolicy(asyncEventChannelCreation.getOrderPolicy()); List<GatewayEventFilter> gatewayEventFilters = asyncEventChannelCreation.getGatewayEventFilters(); for (GatewayEventFilter gatewayEventFilter : gatewayEventFilters) { factory.addGatewayEventFilter(gatewayEventFilter); } factory.setGatewayEventSubstitutionListener(asyncEventChannelCreation.getGatewayEventSubstitutionFilter()); AsyncEventQueue asyncEventChannel = factory.create(asyncEventChannelCreation.getId(), asyncEventChannelCreation.getAsyncEventListener()); stack.pop(); }
AsyncEventQueueFactory factory = cache.createAsyncEventQueueFactory(); factory.setBatchSize(100); factory.setBatchTimeInterval(500);
AsyncEventQueueFactory factory = cache.createAsyncEventQueueFactory(); factory.setBatchSize(100); factory.setBatchTimeInterval(500);