This commit is contained in:
Phillip Webb 2014-03-08 21:38:09 -08:00
parent 7f8316708a
commit 22e397cda2
7 changed files with 52 additions and 26 deletions

View File

@ -187,6 +187,7 @@ public class EndpointAutoConfiguration {
@Autowired @Autowired
private final ConfigurableEnvironment environment = new StandardEnvironment(); private final ConfigurableEnvironment environment = new StandardEnvironment();
@Value("${spring.git.properties:classpath:git.properties}") @Value("${spring.git.properties:classpath:git.properties}")
private Resource gitProperties; private Resource gitProperties;
@ -213,7 +214,9 @@ public class EndpointAutoConfiguration {
} }
public static class GitInfo { public static class GitInfo {
private String branch; private String branch;
private final Commit commit = new Commit(); private final Commit commit = new Commit();
public String getBranch() { public String getBranch() {
@ -229,7 +232,9 @@ public class EndpointAutoConfiguration {
} }
public static class Commit { public static class Commit {
private String id; private String id;
private String time; private String time;
public String getId() { public String getId() {
@ -248,7 +253,9 @@ public class EndpointAutoConfiguration {
public void setTime(String time) { public void setTime(String time) {
this.time = time; this.time = time;
} }
} }
} }
} }

View File

@ -44,7 +44,7 @@ import org.springframework.context.annotation.Configuration;
* *
* <p> * <p>
* Additional configuration parameters for Jolokia can be provided by specifying * Additional configuration parameters for Jolokia can be provided by specifying
* <code>jolokia.config. ...</code> properties. See the <a * <code>jolokia.config.*</code> properties. See the <a
* href="http://jolokia.org">http://jolokia.org</a> web site for more information on * href="http://jolokia.org">http://jolokia.org</a> web site for more information on
* supported configuration parameters. * supported configuration parameters.
* *

View File

@ -75,7 +75,7 @@ import com.codahale.metrics.MetricRegistry;
* By default all metric updates go to all {@link MetricWriter} instances in the * By default all metric updates go to all {@link MetricWriter} instances in the
* application context. To change this behaviour define your own metric writer bean called * application context. To change this behaviour define your own metric writer bean called
* "primaryMetricWriter", mark it <code>@Primary</code>, and this one will receive all * "primaryMetricWriter", mark it <code>@Primary</code>, and this one will receive all
* updates from the default counter and gauge services. ALternatively you can provide your * updates from the default counter and gauge services. Alternatively you can provide your
* own counter and gauge services and wire them to whichever writer you choose. * own counter and gauge services and wire them to whichever writer you choose.
* </p> * </p>
* *

View File

@ -20,27 +20,28 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
/** /**
* Configuration properties for ActiveMQ * Configuration properties for ActiveMQ
*
* @author Greg Turnquist * @author Greg Turnquist
*/ */
@ConfigurationProperties(name = "spring.activemq") @ConfigurationProperties(name = "spring.activemq")
public class ActiveMQProperties { public class ActiveMQProperties {
private String brokerURL = "tcp://localhost:61616"; private String brokerUrl = "tcp://localhost:61616";
private boolean inMemory = true; private boolean inMemory = true;
private boolean pooled = false; private boolean pooled = false;
// Will override brokerURL if inMemory is set to true // Will override brokerURL if inMemory is set to true
public String getBrokerURL() { public String getBrokerUrl() {
if (this.inMemory) { if (this.inMemory) {
return "vm://localhost"; return "vm://localhost";
} }
return this.brokerURL; return this.brokerUrl;
} }
public void setBrokerURL(String brokerURL) { public void setBrokerUrl(String brokerUrl) {
this.brokerURL = brokerURL; this.brokerUrl = brokerUrl;
} }
public boolean isInMemory() { public boolean isInMemory() {

View File

@ -24,8 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 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.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -55,21 +53,6 @@ public class JmsTemplateAutoConfiguration {
return jmsTemplate; 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 @Configuration
@ConditionalOnClass(ActiveMQConnectionFactory.class) @ConditionalOnClass(ActiveMQConnectionFactory.class)
@ConditionalOnMissingBean(ConnectionFactory.class) @ConditionalOnMissingBean(ConnectionFactory.class)
@ -84,10 +67,10 @@ public class JmsTemplateAutoConfiguration {
if (this.config.isPooled()) { if (this.config.isPooled()) {
PooledConnectionFactory pool = new PooledConnectionFactory(); PooledConnectionFactory pool = new PooledConnectionFactory();
pool.setConnectionFactory(new ActiveMQConnectionFactory(this.config pool.setConnectionFactory(new ActiveMQConnectionFactory(this.config
.getBrokerURL())); .getBrokerUrl()));
return pool; return pool;
} }
return new ActiveMQConnectionFactory(this.config.getBrokerURL()); return new ActiveMQConnectionFactory(this.config.getBrokerUrl());
} }
} }

View File

@ -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;
}
}

View File

@ -26,6 +26,7 @@ import java.util.concurrent.atomic.AtomicLong;
public class InMemoryMessageRespository implements MessageRepository { public class InMemoryMessageRespository implements MessageRepository {
private static AtomicLong counter = new AtomicLong(); private static AtomicLong counter = new AtomicLong();
private final ConcurrentMap<Long, Message> messages = new ConcurrentHashMap<Long, Message>(); private final ConcurrentMap<Long, Message> messages = new ConcurrentHashMap<Long, Message>();
@Override @Override