use of org.apache.geode.internal.cache.xmlcache.AsyncEventQueueCreation in project geode by apache.
the class AsyncEventQueueFactoryImpl method create.
public AsyncEventQueue create(String asyncQueueId, AsyncEventListener listener) {
if (listener == null) {
throw new IllegalArgumentException(LocalizedStrings.AsyncEventQueue_ASYNC_EVENT_LISTENER_CANNOT_BE_NULL.toLocalizedString());
}
AsyncEventQueue asyncEventQueue = null;
if (this.cache instanceof GemFireCacheImpl) {
if (logger.isDebugEnabled()) {
logger.debug("Creating GatewaySender that underlies the AsyncEventQueue");
}
addAsyncEventListener(listener);
GatewaySender sender = create(AsyncEventQueueImpl.getSenderIdFromAsyncEventQueueId(asyncQueueId));
AsyncEventQueueImpl queue = new AsyncEventQueueImpl(sender, listener);
asyncEventQueue = queue;
this.cache.addAsyncEventQueue(queue);
} else if (this.cache instanceof CacheCreation) {
asyncEventQueue = new AsyncEventQueueCreation(asyncQueueId, attrs, listener);
((CacheCreation) cache).addAsyncEventQueue(asyncEventQueue);
}
if (logger.isDebugEnabled()) {
logger.debug("Returning AsyncEventQueue" + asyncEventQueue);
}
return asyncEventQueue;
}
Aggregations