Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32CCC106A5 for ; Fri, 23 Aug 2013 22:47:33 +0000 (UTC) Received: (qmail 91432 invoked by uid 500); 23 Aug 2013 22:47:33 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 91405 invoked by uid 500); 23 Aug 2013 22:47:33 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 91398 invoked by uid 99); 23 Aug 2013 22:47:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2013 22:47:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2013 22:47:30 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E7D7123888E7; Fri, 23 Aug 2013 22:47:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1517084 - /activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java Date: Fri, 23 Aug 2013 22:47:09 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130823224709.E7D7123888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Fri Aug 23 22:47:09 2013 New Revision: 1517084 URL: http://svn.apache.org/r1517084 Log: https://issues.apache.org/jira/browse/AMQ-4689 Allows for the persistence adapter to implement JobSchedulerStore and also allows for user set JobSchedulerStore to be used even when persitence is off on the broker. Modified: activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java Modified: activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=1517084&r1=1517083&r2=1517084&view=diff ============================================================================== --- activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java (original) +++ activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java Fri Aug 23 22:47:09 2013 @@ -1814,7 +1814,31 @@ public class BrokerService implements Se } public synchronized JobSchedulerStore getJobSchedulerStore() { - if (jobSchedulerStore == null && isSchedulerSupport()) { + + // If support is off don't allow any scheduler even is user configured their own. + if (!isSchedulerSupport()) { + return null; + } + + // If the user configured their own we use it even if persistence is disabled since + // we don't know anything about their implementation. + if (jobSchedulerStore == null) { + + if (!isPersistent()) { + return null; + } + + try { + PersistenceAdapter pa = getPersistenceAdapter(); + if (pa != null && pa instanceof JobSchedulerStore) { + this.jobSchedulerStore = (JobSchedulerStore) pa; + configureService(jobSchedulerStore); + return this.jobSchedulerStore; + } + } catch (IOException e) { + throw new RuntimeException(e); + } + try { String clazz = "org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl"; jobSchedulerStore = (JobSchedulerStore) getClass().getClassLoader().loadClass(clazz).newInstance(); @@ -1825,7 +1849,6 @@ public class BrokerService implements Se } catch (Exception e) { throw new RuntimeException(e); } - } return jobSchedulerStore; }