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
914bdb39
Commit
914bdb39
authored
Jan 27, 2018
by
Johnny Lim
Committed by
Stephane Nicoll
Jan 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
See gh-11811
parent
5332bcbe
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
27 additions
and
15 deletions
+27
-15
JolokiaEndpoint.java
...k/boot/actuate/autoconfigure/jolokia/JolokiaEndpoint.java
+1
-1
ManagementContextConfigurationImportSelector.java
.../server/ManagementContextConfigurationImportSelector.java
+1
-1
WebMvcEndpointChildContextConfiguration.java
.../web/servlet/WebMvcEndpointChildContextConfiguration.java
+0
-1
JolokiaEndpointAutoConfigurationIntegrationTests.java
...est/JolokiaEndpointAutoConfigurationIntegrationTests.java
+2
-3
ServletEndpointRegistrar.java
...k/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
+2
-2
DiscoveredServletEndpoint.java
...te/endpoint/web/annotation/DiscoveredServletEndpoint.java
+1
-1
ServletEndpointDiscoverer.java
...te/endpoint/web/annotation/ServletEndpointDiscoverer.java
+1
-1
WebMvcMetricsFilter.java
...boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java
+1
-1
EndpointServletTests.java
...ework/boot/actuate/endpoint/web/EndpointServletTests.java
+16
-2
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+2
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jolokia/JolokiaEndpoint.java
View file @
914bdb39
...
...
@@ -34,7 +34,7 @@ import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpoint;
@ServletEndpoint
(
id
=
"jolokia"
)
public
class
JolokiaEndpoint
implements
Supplier
<
EndpointServlet
>
{
private
Map
<
String
,
String
>
initParameters
;
private
final
Map
<
String
,
String
>
initParameters
;
public
JolokiaEndpoint
(
Map
<
String
,
String
>
initParameters
)
{
this
.
initParameters
=
initParameters
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextConfigurationImportSelector.java
View file @
914bdb39
...
...
@@ -36,7 +36,7 @@ import org.springframework.core.type.classreading.SimpleMetadataReaderFactory;
/**
* Selects configuration classes for the management context configuration. Entries are
* loaded from {@code /META-INF/spring.factories} under the
* {@code org.springframework.boot.actuate.autoconfigure.ManagementContextConfiguration}
* {@code org.springframework.boot.actuate.autoconfigure.
web.
ManagementContextConfiguration}
* key.
*
* @author Dave Syer
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfiguration.java
View file @
914bdb39
...
...
@@ -36,7 +36,6 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
* @author Stephane Nicoll
* @author Andy Wilkinson
* @author Phillip Webb
* @since 2.0.0
*/
@ManagementContextConfiguration
(
ManagementContextType
.
CHILD
)
@ConditionalOnWebApplication
(
type
=
Type
.
SERVLET
)
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/Jolokia
ManagementContext
ConfigurationIntegrationTests.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/Jolokia
EndpointAuto
ConfigurationIntegrationTests.java
View file @
914bdb39
...
...
@@ -29,7 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.ServletEndpointManagementContextConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.jolokia.JolokiaEndpoint
;
import
org.springframework.boot.actuate.autoconfigure.jolokia.JolokiaEndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration
;
...
...
@@ -55,7 +54,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Integration tests for {@link JolokiaEndpoint}.
* Integration tests for {@link JolokiaEndpoint
AutoConfiguration
}.
*
* @author Stephane Nicoll
*/
...
...
@@ -63,7 +62,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@DirtiesContext
@TestPropertySource
(
properties
=
"management.endpoints.web.expose=jolokia"
)
public
class
Jolokia
ManagementContext
ConfigurationIntegrationTests
{
public
class
Jolokia
EndpointAuto
ConfigurationIntegrationTests
{
@Autowired
private
TestRestTemplate
restTemplate
;
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
View file @
914bdb39
...
...
@@ -29,8 +29,8 @@ import org.springframework.boot.web.servlet.ServletContextInitializer;
import
org.springframework.util.Assert
;
/**
* {@link ServletContextInitializer} to register {@link ExposableServletEndpoint
}
servlet
* endpoints.
* {@link ServletContextInitializer} to register {@link ExposableServletEndpoint servlet
* endpoints
}
.
*
* @author Phillip Webb
* @since 2.0.0
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredServletEndpoint.java
View file @
914bdb39
...
...
@@ -46,7 +46,7 @@ class DiscoveredServletEndpoint extends AbstractDiscoveredEndpoint<Operation>
()
->
"ServletEndpoint bean "
+
beanType
+
" must be a supplier"
);
Object
supplied
=
((
Supplier
<?>)
endpointBean
).
get
();
Assert
.
state
(
supplied
!=
null
,
"ServletEndpoint bean "
+
beanType
+
" must not supply null"
);
()
->
"ServletEndpoint bean "
+
beanType
+
" must not supply null"
);
Assert
.
state
(
supplied
instanceof
EndpointServlet
,
()
->
"ServletEndpoint bean "
+
beanType
+
" must supply an EndpointServlet"
);
this
.
endpointServlet
=
(
EndpointServlet
)
supplied
;
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscoverer.java
View file @
914bdb39
...
...
@@ -44,7 +44,7 @@ public class ServletEndpointDiscoverer
private
final
PathMapper
endpointPathMapper
;
/**
* Create a new {@link ServletEndpoint
Filt
er} instance.
* Create a new {@link ServletEndpoint
Discover
er} instance.
* @param applicationContext the source application context
* @param endpointPathMapper the endpoint path mapper
* @param filters filters to apply
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java
View file @
914bdb39
...
...
@@ -83,7 +83,7 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
* Create a new {@link WebMvcMetricsFilter} instance.
* @param context the source application context
* @param registry the meter registry
* @param tagsProvider the tags provier
* @param tagsProvider the tags provi
d
er
* @param metricName the metric name
* @param autoTimeRequests if requests should be automatically timed
*/
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java
View file @
914bdb39
...
...
@@ -76,14 +76,14 @@ public class EndpointServletTests {
public
void
withInitParameterNullName
()
{
EndpointServlet
endpointServlet
=
new
EndpointServlet
(
TestServlet
.
class
);
this
.
thrown
.
expect
(
IllegalArgumentException
.
class
);
endpointServlet
.
withInitParameter
s
(
Collections
.
singletonMap
(
null
,
"value"
)
);
endpointServlet
.
withInitParameter
(
null
,
"value"
);
}
@Test
public
void
withInitParameterEmptyName
()
{
EndpointServlet
endpointServlet
=
new
EndpointServlet
(
TestServlet
.
class
);
this
.
thrown
.
expect
(
IllegalArgumentException
.
class
);
endpointServlet
.
withInitParameter
s
(
Collections
.
singletonMap
(
" "
,
"value"
)
);
endpointServlet
.
withInitParameter
(
" "
,
"value"
);
}
@Test
...
...
@@ -102,6 +102,20 @@ public class EndpointServletTests {
entry
(
"a"
,
"b1"
),
entry
(
"c"
,
"d"
),
entry
(
"e"
,
"f"
));
}
@Test
public
void
withInitParametersNullName
()
{
EndpointServlet
endpointServlet
=
new
EndpointServlet
(
TestServlet
.
class
);
this
.
thrown
.
expect
(
IllegalArgumentException
.
class
);
endpointServlet
.
withInitParameters
(
Collections
.
singletonMap
(
null
,
"value"
));
}
@Test
public
void
withInitParametersEmptyName
()
{
EndpointServlet
endpointServlet
=
new
EndpointServlet
(
TestServlet
.
class
);
this
.
thrown
.
expect
(
IllegalArgumentException
.
class
);
endpointServlet
.
withInitParameters
(
Collections
.
singletonMap
(
" "
,
"value"
));
}
@Test
public
void
withInitParametersShouldCreateNewInstance
()
{
EndpointServlet
endpointServlet
=
new
EndpointServlet
(
TestServlet
.
class
);
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
914bdb39
...
...
@@ -500,7 +500,7 @@ to augment an existing endpoint.
TIP: If you add endpoints as a library feature, consider adding a configuration class
annotated with `@ManagementContextConfiguration` to `/META-INF/spring.factories` under the
following key:
`org.springframework.boot.actuate.autoconfigure.ManagementContextConfiguration`. If you do
`org.springframework.boot.actuate.autoconfigure.
web.
ManagementContextConfiguration`. If you do
so and if your users ask for a separate management port or address, the endpoint moves to
a child context with all the other web endpoints.
...
...
@@ -1014,7 +1014,7 @@ Maven, you would add the following dependency:
----
The Jolokia endpoint can then be exposed by adding `jolokia` or `*` to the
`management.endpoints.web.expose` property. You can then
be accessed
it by using
`management.endpoints.web.expose` property. You can then
access
it by using
`/actuator/jolokia` on your management HTTP server.
...
...
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