Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
a3f3de22
Commit
a3f3de22
authored
Mar 08, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
644ae2c2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
16 deletions
+19
-16
HealthIndicatorAutoConfiguration.java
...tuate/autoconfigure/HealthIndicatorAutoConfiguration.java
+1
-2
EhCacheStatisticsProvider.java
...amework/boot/actuate/cache/EhCacheStatisticsProvider.java
+3
-3
CouchbaseAutoConfiguration.java
...t/autoconfigure/couchbase/CouchbaseAutoConfiguration.java
+3
-1
ProjectInfoAutoConfiguration.java
...boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
+6
-5
CouchbaseRepositoriesAutoConfigurationTests.java
...ouchbase/CouchbaseRepositoriesAutoConfigurationTests.java
+2
-3
ProjectInfoAutoConfigurationTests.java
...autoconfigure/info/ProjectInfoAutoConfigurationTests.java
+0
-1
howto.adoc
spring-boot-docs/src/main/asciidoc/howto.adoc
+4
-0
TomcatEmbeddedServletContainerFactoryTests.java
...ed/tomcat/TomcatEmbeddedServletContainerFactoryTests.java
+0
-1
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java
View file @
a3f3de22
...
@@ -105,8 +105,7 @@ public class HealthIndicatorAutoConfiguration {
...
@@ -105,8 +105,7 @@ public class HealthIndicatorAutoConfiguration {
private
final
HealthIndicatorProperties
properties
;
private
final
HealthIndicatorProperties
properties
;
public
HealthIndicatorAutoConfiguration
(
public
HealthIndicatorAutoConfiguration
(
HealthIndicatorProperties
properties
)
{
HealthIndicatorProperties
properties
)
{
this
.
properties
=
properties
;
this
.
properties
=
properties
;
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/EhCacheStatisticsProvider.java
View file @
a3f3de22
...
@@ -35,8 +35,8 @@ public class EhCacheStatisticsProvider implements CacheStatisticsProvider<EhCach
...
@@ -35,8 +35,8 @@ public class EhCacheStatisticsProvider implements CacheStatisticsProvider<EhCach
DefaultCacheStatistics
statistics
=
new
DefaultCacheStatistics
();
DefaultCacheStatistics
statistics
=
new
DefaultCacheStatistics
();
StatisticsGateway
ehCacheStatistics
=
cache
.
getNativeCache
().
getStatistics
();
StatisticsGateway
ehCacheStatistics
=
cache
.
getNativeCache
().
getStatistics
();
statistics
.
setSize
(
ehCacheStatistics
.
getSize
());
statistics
.
setSize
(
ehCacheStatistics
.
getSize
());
D
ouble
hitRatio
=
cacheHitRatio
(
ehCacheStatistics
);
d
ouble
hitRatio
=
cacheHitRatio
(
ehCacheStatistics
);
if
(!
hitRatio
.
isNaN
(
))
{
if
(!
Double
.
isNaN
(
hitRatio
))
{
// ratio is calculated 'racily' and can drift marginally above unity,
// ratio is calculated 'racily' and can drift marginally above unity,
// so we cap it here
// so we cap it here
double
sanitizedHitRatio
=
(
hitRatio
>
1
?
1
:
hitRatio
);
double
sanitizedHitRatio
=
(
hitRatio
>
1
?
1
:
hitRatio
);
...
@@ -46,7 +46,7 @@ public class EhCacheStatisticsProvider implements CacheStatisticsProvider<EhCach
...
@@ -46,7 +46,7 @@ public class EhCacheStatisticsProvider implements CacheStatisticsProvider<EhCach
return
statistics
;
return
statistics
;
}
}
private
static
D
ouble
cacheHitRatio
(
StatisticsGateway
stats
)
{
private
d
ouble
cacheHitRatio
(
StatisticsGateway
stats
)
{
long
hitCount
=
stats
.
cacheHitCount
();
long
hitCount
=
stats
.
cacheHitCount
();
long
cacheMissCount
=
stats
.
cacheMissCount
();
long
cacheMissCount
=
stats
.
cacheMissCount
();
return
((
double
)
hitCount
)
/
(
hitCount
+
cacheMissCount
);
return
((
double
)
hitCount
)
/
(
hitCount
+
cacheMissCount
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java
View file @
a3f3de22
...
@@ -57,9 +57,11 @@ public class CouchbaseAutoConfiguration {
...
@@ -57,9 +57,11 @@ public class CouchbaseAutoConfiguration {
@Bean
@Bean
@ConditionalOnBean
(
Validator
.
class
)
@ConditionalOnBean
(
Validator
.
class
)
public
ValidatingCouchbaseEventListener
validationEventListener
(
Validator
validator
)
{
public
ValidatingCouchbaseEventListener
validationEventListener
(
Validator
validator
)
{
return
new
ValidatingCouchbaseEventListener
(
validator
);
return
new
ValidatingCouchbaseEventListener
(
validator
);
}
}
}
}
@Configuration
@Configuration
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
View file @
a3f3de22
...
@@ -74,8 +74,8 @@ public class ProjectInfoAutoConfiguration {
...
@@ -74,8 +74,8 @@ public class ProjectInfoAutoConfiguration {
protected
void
bindPropertiesTo
(
Object
target
,
Resource
location
,
String
prefix
)
protected
void
bindPropertiesTo
(
Object
target
,
Resource
location
,
String
prefix
)
throws
BindException
,
IOException
{
throws
BindException
,
IOException
{
PropertiesConfigurationFactory
<
Object
>
factory
=
PropertiesConfigurationFactory
<
Object
>
factory
=
new
PropertiesConfigurationFactory
<
Object
>(
new
PropertiesConfigurationFactory
<
Object
>(
target
);
target
);
factory
.
setConversionService
(
this
.
conversionService
);
factory
.
setConversionService
(
this
.
conversionService
);
factory
.
setTargetName
(
prefix
);
factory
.
setTargetName
(
prefix
);
Properties
gitInfoProperties
=
PropertiesLoaderUtils
.
loadProperties
(
location
);
Properties
gitInfoProperties
=
PropertiesLoaderUtils
.
loadProperties
(
location
);
...
@@ -89,7 +89,6 @@ public class ProjectInfoAutoConfiguration {
...
@@ -89,7 +89,6 @@ public class ProjectInfoAutoConfiguration {
return
conversionService
;
return
conversionService
;
}
}
static
class
GitResourceAvailableCondition
extends
SpringBootCondition
{
static
class
GitResourceAvailableCondition
extends
SpringBootCondition
{
private
final
ResourceLoader
defaultResourceLoader
=
new
DefaultResourceLoader
();
private
final
ResourceLoader
defaultResourceLoader
=
new
DefaultResourceLoader
();
...
@@ -125,7 +124,8 @@ public class ProjectInfoAutoConfiguration {
...
@@ -125,7 +124,8 @@ public class ProjectInfoAutoConfiguration {
if
(
epoch
!=
null
)
{
if
(
epoch
!=
null
)
{
return
new
Date
(
epoch
);
return
new
Date
(
epoch
);
}
}
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ssX"
,
Locale
.
US
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ssX"
,
Locale
.
US
);
try
{
try
{
return
format
.
parse
(
s
);
return
format
.
parse
(
s
);
}
}
...
@@ -145,10 +145,11 @@ public class ProjectInfoAutoConfiguration {
...
@@ -145,10 +145,11 @@ public class ProjectInfoAutoConfiguration {
try
{
try
{
return
Long
.
parseLong
(
s
)
*
1000
;
return
Long
.
parseLong
(
s
)
*
1000
;
}
}
catch
(
NumberFormatException
e
)
{
catch
(
NumberFormatException
e
x
)
{
return
null
;
return
null
;
}
}
}
}
}
}
}
}
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/couchbase/CouchbaseRepositoriesAutoConfigurationTests.java
View file @
a3f3de22
...
@@ -64,7 +64,8 @@ public class CouchbaseRepositoriesAutoConfigurationTests {
...
@@ -64,7 +64,8 @@ public class CouchbaseRepositoriesAutoConfigurationTests {
@Test
@Test
public
void
disableRepository
()
{
public
void
disableRepository
()
{
load
(
DefaultConfiguration
.
class
,
"spring.data.couchbase.repositories.enabled=false"
);
load
(
DefaultConfiguration
.
class
,
"spring.data.couchbase.repositories.enabled=false"
);
assertThat
(
this
.
context
.
getBeansOfType
(
CityRepository
.
class
)).
hasSize
(
0
);
assertThat
(
this
.
context
.
getBeansOfType
(
CityRepository
.
class
)).
hasSize
(
0
);
}
}
...
@@ -87,14 +88,12 @@ public class CouchbaseRepositoriesAutoConfigurationTests {
...
@@ -87,14 +88,12 @@ public class CouchbaseRepositoriesAutoConfigurationTests {
this
.
context
=
context
;
this
.
context
=
context
;
}
}
@Configuration
@Configuration
@TestAutoConfigurationPackage
(
City
.
class
)
@TestAutoConfigurationPackage
(
City
.
class
)
static
class
CouchbaseNotAvailableConfiguration
{
static
class
CouchbaseNotAvailableConfiguration
{
}
}
@Configuration
@Configuration
@TestAutoConfigurationPackage
(
City
.
class
)
@TestAutoConfigurationPackage
(
City
.
class
)
@Import
(
CouchbaseTestConfiguration
.
class
)
@Import
(
CouchbaseTestConfiguration
.
class
)
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfigurationTests.java
View file @
a3f3de22
...
@@ -86,7 +86,6 @@ public class ProjectInfoAutoConfigurationTests {
...
@@ -86,7 +86,6 @@ public class ProjectInfoAutoConfigurationTests {
assertThat
(
gitInfo
).
isSameAs
(
this
.
context
.
getBean
(
"customGitInfo"
));
assertThat
(
gitInfo
).
isSameAs
(
this
.
context
.
getBean
(
"customGitInfo"
));
}
}
private
void
load
(
String
...
environment
)
{
private
void
load
(
String
...
environment
)
{
load
(
null
,
environment
);
load
(
null
,
environment
);
}
}
...
...
spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
a3f3de22
...
@@ -438,6 +438,7 @@ in the '`Spring Boot features`' section, or the
...
@@ -438,6 +438,7 @@ in the '`Spring Boot features`' section, or the
code.
code.
[[howto-user-a-random-unassigned-http-port]]
[[howto-user-a-random-unassigned-http-port]]
=== Use a random unassigned HTTP port
=== Use a random unassigned HTTP port
To scan for a free port (using OS natives to prevent clashes) use `server.port=0`.
To scan for a free port (using OS natives to prevent clashes) use `server.port=0`.
...
@@ -507,6 +508,8 @@ the two to configure programmatically. See the
...
@@ -507,6 +508,8 @@ the two to configure programmatically. See the
{github-code}/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors[`spring-boot-sample-tomcat-multi-connectors`]
{github-code}/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors[`spring-boot-sample-tomcat-multi-connectors`]
sample project for an example.
sample project for an example.
[[howto-configure-accesslogs]]
[[howto-configure-accesslogs]]
=== Configure Access Logging
=== Configure Access Logging
Access logs can be configured for Tomcat and Undertow via their respective namespaces.
Access logs can be configured for Tomcat and Undertow via their respective namespaces.
...
@@ -538,6 +541,7 @@ Logs are stored in a `logs` directory relative to the working directory of the
...
@@ -538,6 +541,7 @@ Logs are stored in a `logs` directory relative to the working directory of the
application. This can be customized via `server.undertow.accesslog.directory`.
application. This can be customized via `server.undertow.accesslog.directory`.
[[howto-use-behind-a-proxy-server]]
[[howto-use-behind-a-proxy-server]]
[[howto-use-tomcat-behind-a-proxy-server]]
[[howto-use-tomcat-behind-a-proxy-server]]
=== Use behind a front-end proxy server
=== Use behind a front-end proxy server
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactoryTests.java
View file @
a3f3de22
...
@@ -344,7 +344,6 @@ public class TomcatEmbeddedServletContainerFactoryTests
...
@@ -344,7 +344,6 @@ public class TomcatEmbeddedServletContainerFactoryTests
public
void
startupFailureDoesNotResultInUnstoppedThreadsBeingReported
()
public
void
startupFailureDoesNotResultInUnstoppedThreadsBeingReported
()
throws
IOException
{
throws
IOException
{
super
.
portClashOfPrimaryConnectorResultsInPortInUseException
();
super
.
portClashOfPrimaryConnectorResultsInPortInUseException
();
String
string
=
this
.
outputCapture
.
toString
();
String
string
=
this
.
outputCapture
.
toString
();
assertThat
(
string
)
assertThat
(
string
)
.
doesNotContain
(
"appears to have started a thread named [main]"
);
.
doesNotContain
(
"appears to have started a thread named [main]"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment