Author: dejanb
Date: Mon Sep 15 05:15:24 2008
New Revision: 695445
URL: http://svn.apache.org/viewvc?rev=695445&view=rev
Log:
Patch applied for https://issues.apache.org/activemq/browse/AMQ-1237
Added:
activemq/trunk/assembly/src/release/conf/credentials.properties
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
activemq/trunk/assembly/src/release/conf/activemq.xml
activemq/trunk/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java?rev=695445&r1=695444&r2=695445&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java
Mon Sep 15 05:15:24 2008
@@ -44,6 +44,8 @@
private static final Log LOG = LogFactory.getLog(CommandAgent.class);
private String brokerUrl = "vm://localhost";
+ private String username;
+ private String password;
private ConnectionFactory connectionFactory;
private Connection connection;
private Destination commandDestination;
@@ -122,9 +124,25 @@
public void setBrokerUrl(String brokerUrl) {
this.brokerUrl = brokerUrl;
- }
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
- public ConnectionFactory getConnectionFactory() {
+ public ConnectionFactory getConnectionFactory() {
if (connectionFactory == null) {
connectionFactory = new ActiveMQConnectionFactory(brokerUrl);
}
@@ -160,7 +178,7 @@
}
protected Connection createConnection() throws JMSException {
- return getConnectionFactory().createConnection();
+ return getConnectionFactory().createConnection(username, password);
}
protected Destination createCommandDestination() {
Modified: activemq/trunk/assembly/src/release/conf/activemq.xml
URL:
http://svn.apache.org/viewvc/activemq/trunk/assembly/src/release/conf/activemq.xml?rev=695445&r1=695444&r2=695445&view=diff
==============================================================================
--- activemq/trunk/assembly/src/release/conf/activemq.xml (original)
+++ activemq/trunk/assembly/src/release/conf/activemq.xml Mon Sep 15 05:15:24
2008
@@ -24,7 +24,11 @@
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<!-- Allows us to use system properties as variables in this configuration
file -->
- <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+ <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+ <value>file://${activemq.base}/conf/credentials.properties</value>
+ </property>
+ </bean>
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="localhost" dataDirectory="${activemq.base}/data">
@@ -133,14 +137,20 @@
<!-- configure the camel activemq component to use the current broker -->
<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent" >
- <property name="brokerURL"
value="vm://localhost?create=false&waitForStart=10000" />
+ <property name="connectionFactory">
+ <bean class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL"
value="vm://localhost?create=false&waitForStart=10000" />
+ <property name="userName" value="${activemq.username}"/>
+ <property name="password" value="${activemq.password}"/>
+ </bean>
+ </property>
</bean>
<!-- Uncomment to create a command agent to respond to message based admin
commands on the ActiveMQ.Agent topic -->
<!--
- <commandAgent xmlns="http://activemq.apache.org/schema/core"
brokerUrl="vm://localhost"/>
+ <commandAgent xmlns="http://activemq.apache.org/schema/core"
brokerUrl="vm://localhost" username="${activemq.username}"
password="${activemq.password}"/>
-->
Added: activemq/trunk/assembly/src/release/conf/credentials.properties
URL:
http://svn.apache.org/viewvc/activemq/trunk/assembly/src/release/conf/credentials.properties?rev=695445&view=auto
==============================================================================
--- activemq/trunk/assembly/src/release/conf/credentials.properties (added)
+++ activemq/trunk/assembly/src/release/conf/credentials.properties Mon Sep 15
05:15:24 2008
@@ -0,0 +1,2 @@
+activemq.username=system
+activemq.password=manager
\ No newline at end of file
Modified:
activemq/trunk/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml
URL:
http://svn.apache.org/viewvc/activemq/trunk/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml?rev=695445&r1=695444&r2=695445&view=diff
==============================================================================
---
activemq/trunk/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml
(original)
+++
activemq/trunk/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml
Mon Sep 15 05:15:24 2008
@@ -18,7 +18,11 @@
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
- <bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
/>
+ <bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="locations">
+
<value>file://${activemq.base}/conf/credentials.properties</value>
+ </property>
+ </bean>
<!-- use the following bean for a local in-JVM broker -->
<bean id="brokerQuery" class="org.apache.activemq.web.SingletonBrokerFacade"
autowire='constructor' singleton="false"/>
@@ -30,6 +34,8 @@
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost"/>
+ <property name="userName" value="${activemq.username}"/>
+ <property name="password" value="${activemq.password}"/>
</bean>
<bean id="queueBrowser" class="org.apache.activemq.web.QueueBrowseQuery"
autowire='constructor' singleton="false"/>