Search in sources :

Example 1 with DisruptorBlockingQueue

use of com.conversantmedia.util.concurrent.DisruptorBlockingQueue in project karaf by apache.

the class Activator method createQueue.

@SuppressWarnings("unchecked")
private BlockingQueue<EventImpl> createQueue() throws Exception {
    String type = getString(QUEUE_TYPE, null);
    int size = getInt(QUEUE_SIZE, 1024);
    if ("ArrayBlockingQueue".equals(type)) {
        return new ArrayBlockingQueue<>(size);
    } else if ("DisruptorBlockingQueue".equals(type)) {
        return new DisruptorBlockingQueue(size);
    } else if (type != null) {
        logger.warn("Unknown queue type: " + type + "");
    }
    try {
        return new DisruptorBlockingQueue(size);
    } catch (NoClassDefFoundError t) {
        return new ArrayBlockingQueue<>(size);
    }
}
Also used : ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) DisruptorBlockingQueue(com.conversantmedia.util.concurrent.DisruptorBlockingQueue)

Aggregations

DisruptorBlockingQueue (com.conversantmedia.util.concurrent.DisruptorBlockingQueue)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1