You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2012/07/18 18:19:31 UTC
svn commit: r1363003 - in /activemq/trunk:
activemq-core/src/main/java/org/apache/activemq/broker/
activemq-core/src/main/java/org/apache/activemq/xbean/
activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/
Author: dejanb
Date: Wed Jul 18 16:19:31 2012
New Revision: 1363003
URL: http://svn.apache.org/viewvc?rev=1363003&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3696 - use startAsync property instead of separate method
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/blueprint.xml
activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/spring.xml
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=1363003&r1=1363002&r2=1363003&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java Wed Jul 18 16:19:31 2012
@@ -222,8 +222,8 @@ public class BrokerService implements Se
private DestinationFilter virtualConsumerDestinationFilter;
private final Object persistenceAdapterLock = new Object();
- private boolean persistenceAdapterStarted = false;
private Throwable startException = null;
+ private boolean startAsync = false;
static {
String localHostName = "localhost";
@@ -496,19 +496,11 @@ public class BrokerService implements Se
@PostConstruct
public void autoStart() throws Exception {
if(shouldAutostart()) {
- startAsync();
+ start();
}
}
public void start() throws Exception {
- doStart(false);
- }
-
- public void startAsync() throws Exception {
- doStart(true);
- }
-
- public void doStart(boolean async) throws Exception {
if (stopped.get() || !started.compareAndSet(false, true)) {
// lets just ignore redundant start() calls
// as its way too easy to not be completely sure if start() has been
@@ -529,9 +521,8 @@ public class BrokerService implements Se
startManagementContext();
}
- startPersistenceAdapter(async);
- startBroker(async);
- startedLatch.countDown();
+ startPersistenceAdapter(startAsync);
+ startBroker(startAsync);
} catch (Exception e) {
LOG.error("Failed to start ActiveMQ JMS Message Broker (" + getBrokerName() + ", " + brokerId + "). Reason: " + e, e);
try {
@@ -599,7 +590,6 @@ public class BrokerService implements Se
}
private void doStartBroker() throws Exception {
-
if (startException != null) {
return;
}
@@ -644,6 +634,7 @@ public class BrokerService implements Se
LOG.info("ActiveMQ JMS Message Broker (" + getBrokerName() + ", " + brokerId + ") started");
getBroker().brokerServiceStarted();
checkSystemUsageLimits();
+ startedLatch.countDown();
}
/**
@@ -2790,4 +2781,12 @@ public class BrokerService implements Se
public Throwable getStartException() {
return startException;
}
+
+ public boolean isStartAsync() {
+ return startAsync;
+ }
+
+ public void setStartAsync(boolean startAsync) {
+ this.startAsync = startAsync;
+ }
}
Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java?rev=1363003&r1=1363002&r2=1363003&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java Wed Jul 18 16:19:31 2012
@@ -57,7 +57,7 @@ public class XBeanBrokerService extends
public void afterPropertiesSet() throws Exception {
ensureSystemUsageHasStore();
if (shouldAutostart()) {
- startAsync();
+ start();
}
}
Modified: activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/blueprint.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/blueprint.xml?rev=1363003&r1=1363002&r2=1363003&view=diff
==============================================================================
--- activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/blueprint.xml (original)
+++ activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/blueprint.xml Wed Jul 18 16:19:31 2012
@@ -22,7 +22,7 @@
<!-- Allows us to use system properties as variables in this configuration file -->
<ext:property-placeholder />
- <broker xmlns="http://activemq.apache.org/schema/core" brokerName="${name}" dataDirectory="${karaf.data}/activemq/${name}" useShutdownHook="false">
+ <broker xmlns="http://activemq.apache.org/schema/core" brokerName="${name}" dataDirectory="${karaf.data}/activemq/${name}" useShutdownHook="false" startAsync="true">
<!--
For better performances use VM cursor and small memory limit.
Modified: activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/spring.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/spring.xml?rev=1363003&r1=1363002&r2=1363003&view=diff
==============================================================================
--- activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/spring.xml (original)
+++ activemq/trunk/activemq-karaf/src/main/resources/org/apache/activemq/karaf/commands/spring.xml Wed Jul 18 16:19:31 2012
@@ -27,7 +27,7 @@
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
- <broker xmlns="http://activemq.apache.org/schema/core" brokerName="${name}" dataDirectory="${karaf.data}/activemq/${name}" useShutdownHook="false">
+ <broker xmlns="http://activemq.apache.org/schema/core" brokerName="${name}" dataDirectory="${karaf.data}/activemq/${name}" useShutdownHook="false" startAsync="true">
<!--
For better performances use VM cursor and small memory limit.