Polish
This commit is contained in:
@@ -20,27 +20,28 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties for ActiveMQ
|
||||
*
|
||||
* @author Greg Turnquist
|
||||
*/
|
||||
@ConfigurationProperties(name = "spring.activemq")
|
||||
public class ActiveMQProperties {
|
||||
|
||||
private String brokerURL = "tcp://localhost:61616";
|
||||
private String brokerUrl = "tcp://localhost:61616";
|
||||
|
||||
private boolean inMemory = true;
|
||||
|
||||
private boolean pooled = false;
|
||||
|
||||
// Will override brokerURL if inMemory is set to true
|
||||
public String getBrokerURL() {
|
||||
public String getBrokerUrl() {
|
||||
if (this.inMemory) {
|
||||
return "vm://localhost";
|
||||
}
|
||||
return this.brokerURL;
|
||||
return this.brokerUrl;
|
||||
}
|
||||
|
||||
public void setBrokerURL(String brokerURL) {
|
||||
this.brokerURL = brokerURL;
|
||||
public void setBrokerUrl(String brokerUrl) {
|
||||
this.brokerUrl = brokerUrl;
|
||||
}
|
||||
|
||||
public boolean isInMemory() {
|
||||
|
||||
@@ -24,8 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.jms.JmsTemplateAutoConfiguration.JmsTemplateProperties;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -55,21 +53,6 @@ public class JmsTemplateAutoConfiguration {
|
||||
return jmsTemplate;
|
||||
}
|
||||
|
||||
@ConfigurationProperties(name = "spring.jms")
|
||||
public static class JmsTemplateProperties {
|
||||
|
||||
private boolean pubSubDomain = true;
|
||||
|
||||
public boolean isPubSubDomain() {
|
||||
return this.pubSubDomain;
|
||||
}
|
||||
|
||||
public void setPubSubDomain(boolean pubSubDomain) {
|
||||
this.pubSubDomain = pubSubDomain;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnClass(ActiveMQConnectionFactory.class)
|
||||
@ConditionalOnMissingBean(ConnectionFactory.class)
|
||||
@@ -84,10 +67,10 @@ public class JmsTemplateAutoConfiguration {
|
||||
if (this.config.isPooled()) {
|
||||
PooledConnectionFactory pool = new PooledConnectionFactory();
|
||||
pool.setConnectionFactory(new ActiveMQConnectionFactory(this.config
|
||||
.getBrokerURL()));
|
||||
.getBrokerUrl()));
|
||||
return pool;
|
||||
}
|
||||
return new ActiveMQConnectionFactory(this.config.getBrokerURL());
|
||||
return new ActiveMQConnectionFactory(this.config.getBrokerUrl());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.jms;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(name = "spring.jms")
|
||||
public class JmsTemplateProperties {
|
||||
|
||||
private boolean pubSubDomain = true;
|
||||
|
||||
public boolean isPubSubDomain() {
|
||||
return this.pubSubDomain;
|
||||
}
|
||||
|
||||
public void setPubSubDomain(boolean pubSubDomain) {
|
||||
this.pubSubDomain = pubSubDomain;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user