Package org.apache.sling.event.impl.jobs.config

Examples of org.apache.sling.event.impl.jobs.config.InternalQueueConfiguration


     * @param queueInfo The queue info
     * @param topics The topics
     */
    private void start(final QueueInfo queueInfo,
            final Set<String> topics) {
        final InternalQueueConfiguration config = queueInfo.queueConfiguration;
        // get or create queue
        AbstractJobQueue queue = null;
        // we synchronize to avoid creating a queue which is about to be removed during cleanup
        synchronized ( queuesLock ) {
            queue = this.queues.get(queueInfo.queueName);
            // check for reconfiguration, we really do an identity check here(!)
            if ( queue != null && queue.getConfiguration() != config ) {
                this.outdateQueue(queue);
                // we use a new queue with the configuration
                queue = null;
            }
            if ( queue == null ) {
                if ( config.getType() == QueueConfiguration.Type.ORDERED
                  || config.getType() == QueueConfiguration.Type.TOPIC_ROUND_ROBIN ) {
                    queue = new OrderedJobQueue(queueInfo.queueName, config, queueServices, topics);
                } else if ( config.getType() == QueueConfiguration.Type.UNORDERED ) {
                    queue = new ParallelJobQueue(queueInfo.queueName, config, queueServices, topics);
                }
                // this is just a sanity check, actually we always have a queue instance here
                if ( queue != null ) {
                    queues.put(queueInfo.queueName, queue);
View Full Code Here

TOP

Related Classes of org.apache.sling.event.impl.jobs.config.InternalQueueConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.