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
0f0c6e07
Commit
0f0c6e07
authored
Jan 08, 2018
by
Johnny Lim
Committed by
Stephane Nicoll
Jan 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
Closes gh-11536
parent
6ea6adb1
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
45 deletions
+28
-45
CacheMeterBinderProvidersConfiguration.java
...metrics/cache/CacheMeterBinderProvidersConfiguration.java
+0
-1
CacheMetricsRegistrarConfiguration.java
...ure/metrics/cache/CacheMetricsRegistrarConfiguration.java
+1
-2
CacheMetricsConfigurationTests.java
...nfigure/metrics/cache/CacheMetricsConfigurationTests.java
+1
-5
AnnotationEndpointDiscoverer.java
...ate/endpoint/annotation/AnnotationEndpointDiscoverer.java
+6
-6
CacheMetricsRegistrar.java
...ork/boot/actuate/metrics/cache/CacheMetricsRegistrar.java
+5
-4
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+4
-16
WebServerFactoryCustomizerBeanPostProcessor.java
...b/server/WebServerFactoryCustomizerBeanPostProcessor.java
+6
-5
SysVinitLaunchScriptIT.java
...ngframework/boot/launchscript/SysVinitLaunchScriptIT.java
+5
-6
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMeterBinderProvidersConfiguration.java
View file @
0f0c6e07
...
@@ -37,7 +37,6 @@ import org.springframework.context.annotation.Configuration;
...
@@ -37,7 +37,6 @@ import org.springframework.context.annotation.Configuration;
* {@link Configuration Auto-configuration} for {@link CacheMeterBinderProvider} beans.
* {@link Configuration Auto-configuration} for {@link CacheMeterBinderProvider} beans.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
(
MeterBinder
.
class
)
@ConditionalOnClass
(
MeterBinder
.
class
)
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java
View file @
0f0c6e07
...
@@ -38,7 +38,6 @@ import org.springframework.util.StringUtils;
...
@@ -38,7 +38,6 @@ import org.springframework.util.StringUtils;
* caches}.
* caches}.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @since 2.0.0
*/
*/
@Configuration
@Configuration
@ConditionalOnBean
(
CacheMeterBinderProvider
.
class
)
@ConditionalOnBean
(
CacheMeterBinderProvider
.
class
)
...
@@ -59,8 +58,8 @@ class CacheMetricsRegistrarConfiguration {
...
@@ -59,8 +58,8 @@ class CacheMetricsRegistrarConfiguration {
Collection
<
CacheMeterBinderProvider
<?>>
binderProviders
,
Collection
<
CacheMeterBinderProvider
<?>>
binderProviders
,
Map
<
String
,
CacheManager
>
cacheManagers
)
{
Map
<
String
,
CacheManager
>
cacheManagers
)
{
this
.
registry
=
registry
;
this
.
registry
=
registry
;
this
.
binderProviders
=
binderProviders
;
this
.
properties
=
properties
;
this
.
properties
=
properties
;
this
.
binderProviders
=
binderProviders
;
this
.
cacheManagers
=
cacheManagers
;
this
.
cacheManagers
=
cacheManagers
;
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java
View file @
0f0c6e07
...
@@ -39,13 +39,12 @@ public class CacheMetricsConfigurationTests {
...
@@ -39,13 +39,12 @@ public class CacheMetricsConfigurationTests {
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
()
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
()
.
withUserConfiguration
(
RegistryConfiguration
.
class
)
.
withUserConfiguration
(
RegistryConfiguration
.
class
)
.
withConfiguration
(
AutoConfigurations
.
of
(
MetricsAutoConfiguration
.
class
))
.
withConfiguration
(
AutoConfigurations
.
of
(
MetricsAutoConfiguration
.
class
,
CacheAutoConfiguration
.
class
))
.
withPropertyValues
(
"management.metrics.use-global-registry=false"
);
.
withPropertyValues
(
"management.metrics.use-global-registry=false"
);
@Test
@Test
public
void
autoConfiguredCacheManagerIsInstrumented
()
{
public
void
autoConfiguredCacheManagerIsInstrumented
()
{
this
.
contextRunner
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
CacheAutoConfiguration
.
class
))
.
withPropertyValues
(
"spring.cache.type=caffeine"
,
.
withPropertyValues
(
"spring.cache.type=caffeine"
,
"spring.cache.cache-names=cache1,cache2"
)
"spring.cache.cache-names=cache1,cache2"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
...
@@ -60,7 +59,6 @@ public class CacheMetricsConfigurationTests {
...
@@ -60,7 +59,6 @@ public class CacheMetricsConfigurationTests {
@Test
@Test
public
void
autoConfiguredCacheManagerWithCustomMetricName
()
{
public
void
autoConfiguredCacheManagerWithCustomMetricName
()
{
this
.
contextRunner
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
CacheAutoConfiguration
.
class
))
.
withPropertyValues
(
.
withPropertyValues
(
"management.metrics.cache.cache-metric-name=custom.name"
,
"management.metrics.cache.cache-metric-name=custom.name"
,
"spring.cache.type=caffeine"
,
"spring.cache.cache-names=cache1"
)
"spring.cache.type=caffeine"
,
"spring.cache.cache-names=cache1"
)
...
@@ -76,7 +74,6 @@ public class CacheMetricsConfigurationTests {
...
@@ -76,7 +74,6 @@ public class CacheMetricsConfigurationTests {
@Test
@Test
public
void
autoConfiguredNonSupportedCacheManagerIsIgnored
()
{
public
void
autoConfiguredNonSupportedCacheManagerIsIgnored
()
{
this
.
contextRunner
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
CacheAutoConfiguration
.
class
))
.
withPropertyValues
(
"spring.cache.type=simple"
,
.
withPropertyValues
(
"spring.cache.type=simple"
,
"spring.cache.cache-names=cache1,cache2"
)
"spring.cache.cache-names=cache1,cache2"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
...
@@ -91,7 +88,6 @@ public class CacheMetricsConfigurationTests {
...
@@ -91,7 +88,6 @@ public class CacheMetricsConfigurationTests {
@Test
@Test
public
void
cacheInstrumentationCanBeDisabled
()
{
public
void
cacheInstrumentationCanBeDisabled
()
{
this
.
contextRunner
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
CacheAutoConfiguration
.
class
))
.
withPropertyValues
(
"management.metrics.cache.instrument-cache=false"
,
.
withPropertyValues
(
"management.metrics.cache.instrument-cache=false"
,
"spring.cache.type=caffeine"
,
"spring.cache.cache-names=cache1"
)
"spring.cache.type=caffeine"
,
"spring.cache.cache-names=cache1"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AnnotationEndpointDiscoverer.java
View file @
0f0c6e07
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -63,7 +63,7 @@ import org.springframework.util.StringUtils;
...
@@ -63,7 +63,7 @@ import org.springframework.util.StringUtils;
public
abstract
class
AnnotationEndpointDiscoverer
<
K
,
T
extends
Operation
>
public
abstract
class
AnnotationEndpointDiscoverer
<
K
,
T
extends
Operation
>
implements
EndpointDiscoverer
<
T
>
{
implements
EndpointDiscoverer
<
T
>
{
private
final
Log
logger
=
LogFactory
.
getLog
(
getClass
()
);
private
static
final
Log
logger
=
LogFactory
.
getLog
(
AnnotationEndpointDiscoverer
.
class
);
private
final
ApplicationContext
applicationContext
;
private
final
ApplicationContext
applicationContext
;
...
@@ -277,10 +277,10 @@ public abstract class AnnotationEndpointDiscoverer<K, T extends Operation>
...
@@ -277,10 +277,10 @@ public abstract class AnnotationEndpointDiscoverer<K, T extends Operation>
catch
(
ClassCastException
ex
)
{
catch
(
ClassCastException
ex
)
{
String
msg
=
ex
.
getMessage
();
String
msg
=
ex
.
getMessage
();
if
(
msg
==
null
||
msg
.
startsWith
(
endpointInfo
.
getClass
().
getName
()))
{
if
(
msg
==
null
||
msg
.
startsWith
(
endpointInfo
.
getClass
().
getName
()))
{
// Possibly a lambda-defined
listen
er which we could not resolve the
// Possibly a lambda-defined
EndpointFilt
er which we could not resolve the
// generic
event
type for
// generic
EndpointInfo
type for
if
(
this
.
logger
.
isDebugEnabled
())
{
if
(
logger
.
isDebugEnabled
())
{
this
.
logger
.
debug
(
"Non-matching info type for f
ilter: "
+
filter
,
ex
);
logger
.
debug
(
"Non-matching EndpointInfo for EndpointF
ilter: "
+
filter
,
ex
);
}
}
return
false
;
return
false
;
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/cache/CacheMetricsRegistrar.java
View file @
0f0c6e07
...
@@ -39,6 +39,8 @@ import org.springframework.core.ResolvableType;
...
@@ -39,6 +39,8 @@ import org.springframework.core.ResolvableType;
*/
*/
public
class
CacheMetricsRegistrar
{
public
class
CacheMetricsRegistrar
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
CacheMetricsRegistrar
.
class
);
private
final
MeterRegistry
registry
;
private
final
MeterRegistry
registry
;
private
final
String
metricName
;
private
final
String
metricName
;
...
@@ -94,12 +96,11 @@ public class CacheMetricsRegistrar {
...
@@ -94,12 +96,11 @@ public class CacheMetricsRegistrar {
catch
(
ClassCastException
ex
)
{
catch
(
ClassCastException
ex
)
{
String
msg
=
ex
.
getMessage
();
String
msg
=
ex
.
getMessage
();
if
(
msg
==
null
||
msg
.
startsWith
(
cache
.
getClass
().
getName
()))
{
if
(
msg
==
null
||
msg
.
startsWith
(
cache
.
getClass
().
getName
()))
{
// Possibly a lambda-defined listener which we could not resolve
// Possibly a lambda-defined CacheMeterBinderProvider which we could not resolve
// the generic event type for
// the generic Cache type for
Log
logger
=
LogFactory
.
getLog
(
getClass
());
if
(
logger
.
isDebugEnabled
())
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
logger
.
debug
(
"Non-matching
event
type for CacheMeterBinderProvider: "
"Non-matching
Cache
type for CacheMeterBinderProvider: "
+
binderProvider
,
+
binderProvider
,
ex
);
ex
);
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
0f0c6e07
...
@@ -98,7 +98,7 @@ public class ServerProperties {
...
@@ -98,7 +98,7 @@ public class ServerProperties {
*/
*/
private
Duration
connectionTimeout
;
private
Duration
connectionTimeout
;
private
Session
session
=
new
Session
();
private
final
Session
session
=
new
Session
();
@NestedConfigurationProperty
@NestedConfigurationProperty
private
Ssl
ssl
;
private
Ssl
ssl
;
...
@@ -109,7 +109,7 @@ public class ServerProperties {
...
@@ -109,7 +109,7 @@ public class ServerProperties {
@NestedConfigurationProperty
@NestedConfigurationProperty
private
final
Http2
http2
=
new
Http2
();
private
final
Http2
http2
=
new
Http2
();
private
Servlet
servlet
=
new
Servlet
();
private
final
Servlet
servlet
=
new
Servlet
();
private
final
Tomcat
tomcat
=
new
Tomcat
();
private
final
Tomcat
tomcat
=
new
Tomcat
();
...
@@ -181,10 +181,6 @@ public class ServerProperties {
...
@@ -181,10 +181,6 @@ public class ServerProperties {
return
this
.
session
;
return
this
.
session
;
}
}
public
void
setSession
(
Session
session
)
{
this
.
session
=
session
;
}
public
Ssl
getSsl
()
{
public
Ssl
getSsl
()
{
return
this
.
ssl
;
return
this
.
ssl
;
}
}
...
@@ -205,10 +201,6 @@ public class ServerProperties {
...
@@ -205,10 +201,6 @@ public class ServerProperties {
return
this
.
servlet
;
return
this
.
servlet
;
}
}
public
void
setServlet
(
Servlet
servlet
)
{
this
.
servlet
=
servlet
;
}
public
Tomcat
getTomcat
()
{
public
Tomcat
getTomcat
()
{
return
this
.
tomcat
;
return
this
.
tomcat
;
}
}
...
@@ -242,7 +234,7 @@ public class ServerProperties {
...
@@ -242,7 +234,7 @@ public class ServerProperties {
private
String
path
=
"/"
;
private
String
path
=
"/"
;
@NestedConfigurationProperty
@NestedConfigurationProperty
private
Jsp
jsp
=
new
Jsp
();
private
final
Jsp
jsp
=
new
Jsp
();
public
String
getContextPath
()
{
public
String
getContextPath
()
{
return
this
.
contextPath
;
return
this
.
contextPath
;
...
@@ -276,10 +268,6 @@ public class ServerProperties {
...
@@ -276,10 +268,6 @@ public class ServerProperties {
return
this
.
jsp
;
return
this
.
jsp
;
}
}
public
void
setJsp
(
Jsp
jsp
)
{
this
.
jsp
=
jsp
;
}
public
String
getServletMapping
()
{
public
String
getServletMapping
()
{
if
(
this
.
path
.
equals
(
""
)
||
this
.
path
.
equals
(
"/"
))
{
if
(
this
.
path
.
equals
(
""
)
||
this
.
path
.
equals
(
"/"
))
{
return
"/"
;
return
"/"
;
...
@@ -359,7 +347,7 @@ public class ServerProperties {
...
@@ -359,7 +347,7 @@ public class ServerProperties {
*/
*/
private
File
storeDir
;
private
File
storeDir
;
private
Cookie
cookie
=
new
Cookie
();
private
final
Cookie
cookie
=
new
Cookie
();
public
Cookie
getCookie
()
{
public
Cookie
getCookie
()
{
return
this
.
cookie
;
return
this
.
cookie
;
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessor.java
View file @
0f0c6e07
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -45,6 +45,8 @@ import org.springframework.util.Assert;
...
@@ -45,6 +45,8 @@ import org.springframework.util.Assert;
public
class
WebServerFactoryCustomizerBeanPostProcessor
public
class
WebServerFactoryCustomizerBeanPostProcessor
implements
BeanPostProcessor
,
BeanFactoryAware
{
implements
BeanPostProcessor
,
BeanFactoryAware
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
WebServerFactoryCustomizerBeanPostProcessor
.
class
);
private
ListableBeanFactory
beanFactory
;
private
ListableBeanFactory
beanFactory
;
private
List
<
WebServerFactoryCustomizer
<?>>
customizers
;
private
List
<
WebServerFactoryCustomizer
<?>>
customizers
;
...
@@ -92,8 +94,8 @@ public class WebServerFactoryCustomizerBeanPostProcessor
...
@@ -92,8 +94,8 @@ public class WebServerFactoryCustomizerBeanPostProcessor
catch
(
ClassCastException
ex
)
{
catch
(
ClassCastException
ex
)
{
String
msg
=
ex
.
getMessage
();
String
msg
=
ex
.
getMessage
();
if
(
msg
==
null
||
msg
.
startsWith
(
webServerFactory
.
getClass
().
getName
()))
{
if
(
msg
==
null
||
msg
.
startsWith
(
webServerFactory
.
getClass
().
getName
()))
{
// Possibly a lambda-defined
listen
er which we could not resolve the
// Possibly a lambda-defined
WebServerFactoryCustomiz
er which we could not resolve the
// generic
event
type for
// generic
WebServerFactory
type for
logLambdaDebug
(
customizer
,
ex
);
logLambdaDebug
(
customizer
,
ex
);
}
}
else
{
else
{
...
@@ -104,9 +106,8 @@ public class WebServerFactoryCustomizerBeanPostProcessor
...
@@ -104,9 +106,8 @@ public class WebServerFactoryCustomizerBeanPostProcessor
private
void
logLambdaDebug
(
WebServerFactoryCustomizer
<?>
customizer
,
private
void
logLambdaDebug
(
WebServerFactoryCustomizer
<?>
customizer
,
ClassCastException
ex
)
{
ClassCastException
ex
)
{
Log
logger
=
LogFactory
.
getLog
(
getClass
());
if
(
logger
.
isDebugEnabled
())
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Non-matching
factory type for c
ustomizer: "
+
customizer
,
ex
);
logger
.
debug
(
"Non-matching
WebServerFactory type for WebServerFactoryC
ustomizer: "
+
customizer
,
ex
);
}
}
}
}
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java
View file @
0f0c6e07
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -403,11 +403,10 @@ public class SysVinitLaunchScriptIT {
...
@@ -403,11 +403,10 @@ public class SysVinitLaunchScriptIT {
@Override
@Override
protected
Void
execute
(
CopyToContainerCmd
command
)
{
protected
Void
execute
(
CopyToContainerCmd
command
)
{
try
{
try
(
InputStream
streamToUpload
=
new
FileInputStream
(
CompressArchiveUtil
InputStream
streamToUpload
=
new
FileInputStream
(
CompressArchiveUtil
.
archiveTARFiles
(
command
.
getFile
().
getParentFile
(),
.
archiveTARFiles
(
command
.
getFile
().
getParentFile
(),
Arrays
.
asList
(
command
.
getFile
()),
Arrays
.
asList
(
command
.
getFile
()),
command
.
getFile
().
getName
()));
command
.
getFile
().
getName
())))
{
WebTarget
webResource
=
getBaseResource
().
path
(
"/containers/{id}/archive"
)
WebTarget
webResource
=
getBaseResource
().
path
(
"/containers/{id}/archive"
)
.
resolveTemplate
(
"id"
,
command
.
getContainer
());
.
resolveTemplate
(
"id"
,
command
.
getContainer
());
webResource
.
queryParam
(
"path"
,
"."
)
webResource
.
queryParam
(
"path"
,
"."
)
...
...
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