Search in sources :

Example 1 with AsyncEventQueueCreation

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;
}
Also used : GatewaySender(org.apache.geode.cache.wan.GatewaySender) SerialAsyncEventQueueCreation(org.apache.geode.internal.cache.xmlcache.SerialAsyncEventQueueCreation) AsyncEventQueueCreation(org.apache.geode.internal.cache.xmlcache.AsyncEventQueueCreation) ParallelAsyncEventQueueCreation(org.apache.geode.internal.cache.xmlcache.ParallelAsyncEventQueueCreation) AsyncEventQueue(org.apache.geode.cache.asyncqueue.AsyncEventQueue) GemFireCacheImpl(org.apache.geode.internal.cache.GemFireCacheImpl) CacheCreation(org.apache.geode.internal.cache.xmlcache.CacheCreation)

Aggregations

AsyncEventQueue (org.apache.geode.cache.asyncqueue.AsyncEventQueue)1 GatewaySender (org.apache.geode.cache.wan.GatewaySender)1 GemFireCacheImpl (org.apache.geode.internal.cache.GemFireCacheImpl)1 AsyncEventQueueCreation (org.apache.geode.internal.cache.xmlcache.AsyncEventQueueCreation)1 CacheCreation (org.apache.geode.internal.cache.xmlcache.CacheCreation)1 ParallelAsyncEventQueueCreation (org.apache.geode.internal.cache.xmlcache.ParallelAsyncEventQueueCreation)1 SerialAsyncEventQueueCreation (org.apache.geode.internal.cache.xmlcache.SerialAsyncEventQueueCreation)1