@ -17,6 +17,7 @@
package org.springframework.boot.actuate.endpoint.web.annotation ;
package org.springframework.boot.actuate.endpoint.web.annotation ;
import java.util.Collection ;
import java.util.Collection ;
import java.util.List ;
import org.springframework.boot.actuate.endpoint.EndpointFilter ;
import org.springframework.boot.actuate.endpoint.EndpointFilter ;
import org.springframework.boot.actuate.endpoint.EndpointId ;
import org.springframework.boot.actuate.endpoint.EndpointId ;
@ -32,7 +33,6 @@ import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier;
import org.springframework.boot.actuate.endpoint.web.WebOperation ;
import org.springframework.boot.actuate.endpoint.web.WebOperation ;
import org.springframework.boot.actuate.endpoint.web.WebOperationRequestPredicate ;
import org.springframework.boot.actuate.endpoint.web.WebOperationRequestPredicate ;
import org.springframework.context.ApplicationContext ;
import org.springframework.context.ApplicationContext ;
import org.springframework.util.Assert ;
/ * *
/ * *
* { @link EndpointDiscoverer } for { @link ExposableWebEndpoint web endpoints } .
* { @link EndpointDiscoverer } for { @link ExposableWebEndpoint web endpoints } .
@ -44,7 +44,7 @@ public class WebEndpointDiscoverer
extends EndpointDiscoverer < ExposableWebEndpoint , WebOperation >
extends EndpointDiscoverer < ExposableWebEndpoint , WebOperation >
implements WebEndpointsSupplier {
implements WebEndpointsSupplier {
private final PathMapper endpointPathMapper ;
private final List< PathMapper> endpointPathMapper s ;
private final RequestPredicateFactory requestPredicateFactory ;
private final RequestPredicateFactory requestPredicateFactory ;
@ -53,25 +53,24 @@ public class WebEndpointDiscoverer
* @param applicationContext the source application context
* @param applicationContext the source application context
* @param parameterValueMapper the parameter value mapper
* @param parameterValueMapper the parameter value mapper
* @param endpointMediaTypes the endpoint media types
* @param endpointMediaTypes the endpoint media types
* @param endpointPathMapper the endpoint path mapper
* @param endpointPathMapper s the endpoint path mapper s
* @param invokerAdvisors invoker advisors to apply
* @param invokerAdvisors invoker advisors to apply
* @param filters filters to apply
* @param filters filters to apply
* /
* /
public WebEndpointDiscoverer ( ApplicationContext applicationContext ,
public WebEndpointDiscoverer ( ApplicationContext applicationContext ,
ParameterValueMapper parameterValueMapper ,
ParameterValueMapper parameterValueMapper ,
EndpointMediaTypes endpointMediaTypes , PathMapper endpointPathMapper ,
EndpointMediaTypes endpointMediaTypes , List< PathMapper> endpointPathMapper s ,
Collection < OperationInvokerAdvisor > invokerAdvisors ,
Collection < OperationInvokerAdvisor > invokerAdvisors ,
Collection < EndpointFilter < ExposableWebEndpoint > > filters ) {
Collection < EndpointFilter < ExposableWebEndpoint > > filters ) {
super ( applicationContext , parameterValueMapper , invokerAdvisors , filters ) ;
super ( applicationContext , parameterValueMapper , invokerAdvisors , filters ) ;
Assert . notNull ( endpointPathMapper , "EndpointPathMapper must not be null" ) ;
this . endpointPathMappers = endpointPathMappers ;
this . endpointPathMapper = endpointPathMapper ;
this . requestPredicateFactory = new RequestPredicateFactory ( endpointMediaTypes ) ;
this . requestPredicateFactory = new RequestPredicateFactory ( endpointMediaTypes ) ;
}
}
@Override
@Override
protected ExposableWebEndpoint createEndpoint ( Object endpointBean , EndpointId id ,
protected ExposableWebEndpoint createEndpoint ( Object endpointBean , EndpointId id ,
boolean enabledByDefault , Collection < WebOperation > operations ) {
boolean enabledByDefault , Collection < WebOperation > operations ) {
String rootPath = this . endpointPathMapper . getRootPath ( id ) ;
String rootPath = PathMapper . getRootPath ( this . endpointPathMappers , id ) ;
return new DiscoveredWebEndpoint ( this , endpointBean , id , rootPath ,
return new DiscoveredWebEndpoint ( this , endpointBean , id , rootPath ,
enabledByDefault , operations ) ;
enabledByDefault , operations ) ;
}
}
@ -79,7 +78,7 @@ public class WebEndpointDiscoverer
@Override
@Override
protected WebOperation createOperation ( EndpointId endpointId ,
protected WebOperation createOperation ( EndpointId endpointId ,
DiscoveredOperationMethod operationMethod , OperationInvoker invoker ) {
DiscoveredOperationMethod operationMethod , OperationInvoker invoker ) {
String rootPath = this . endpointPathMapper . getRootPath ( endpointId ) ;
String rootPath = PathMapper . getRootPath ( this . endpointPathMappers , endpointId ) ;
WebOperationRequestPredicate requestPredicate = this . requestPredicateFactory
WebOperationRequestPredicate requestPredicate = this . requestPredicateFactory
. getRequestPredicate ( endpointId , rootPath , operationMethod ) ;
. getRequestPredicate ( endpointId , rootPath , operationMethod ) ;
return new DiscoveredWebOperation ( endpointId , operationMethod , invoker ,
return new DiscoveredWebOperation ( endpointId , operationMethod , invoker ,