Class EndpointDiscoverer<E extends ExposableEndpoint<O>,O extends Operation>
- java.lang.Object
- org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer<E,O>
- Type Parameters:
E
- the endpoint typeO
- the operation type
- All Implemented Interfaces:
EndpointsSupplier<E>
- Direct Known Subclasses:
ControllerEndpointDiscoverer
,JmxEndpointDiscoverer
,ServletEndpointDiscoverer
,WebEndpointDiscoverer
public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>,O extends Operation> extends Object implements EndpointsSupplier<E>
A Base forEndpointsSupplier
implementations that discover@Endpoint
beans and@EndpointExtension
beans in an application context.- Since:
- 2.0.0
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
EndpointDiscoverer.OperationKey
A key generated for anOperation
based on specific criteria from the actual operation implementation.
Constructor Summary
Constructors Constructor Description EndpointDiscoverer(org.springframework.context.ApplicationContext applicationContext, ParameterValueMapper parameterValueMapper, Collection<OperationInvokerAdvisor> invokerAdvisors, Collection<EndpointFilter<E>> filters)
Create a newEndpointDiscoverer
instance.
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract E
createEndpoint(Object endpointBean, EndpointId id, boolean enabledByDefault, Collection<O> operations)
Factory method called to create theendpoint
.protected abstract O
createOperation(EndpointId endpointId, DiscoveredOperationMethod operationMethod, OperationInvoker invoker)
Factory method to create anendpoint operation
.protected abstract EndpointDiscoverer.OperationKey
createOperationKey(O operation)
Create anEndpointDiscoverer.OperationKey
for the given operation.Collection<E>
getEndpoints()
Return the provided endpoints.protected Class<? extends E>
getEndpointType()
protected boolean
isEndpointExposed(Object endpointBean)
Determine if an endpoint bean should be exposed.protected boolean
isExtensionExposed(Object extensionBean)
Determine if an extension bean should be exposed.
Constructor Detail
EndpointDiscoverer
public EndpointDiscoverer(org.springframework.context.ApplicationContext applicationContext, ParameterValueMapper parameterValueMapper, Collection<OperationInvokerAdvisor> invokerAdvisors, Collection<EndpointFilter<E>> filters)
Create a newEndpointDiscoverer
instance.- Parameters:
applicationContext
- the source application contextparameterValueMapper
- the parameter value mapperinvokerAdvisors
- invoker advisors to applyfilters
- filters to apply
Method Detail
getEndpoints
public final Collection<E> getEndpoints()
Description copied from interface:EndpointsSupplier
Return the provided endpoints.- Specified by:
getEndpoints
in interfaceEndpointsSupplier<E extends ExposableEndpoint<O>>
- Returns:
- the endpoints
isExtensionExposed
protected boolean isExtensionExposed(Object extensionBean)
Determine if an extension bean should be exposed. Subclasses can override this method to provide additional logic.- Parameters:
extensionBean
- the extension bean- Returns:
true
if the extension is exposed
isEndpointExposed
protected boolean isEndpointExposed(Object endpointBean)
Determine if an endpoint bean should be exposed. Subclasses can override this method to provide additional logic.- Parameters:
endpointBean
- the endpoint bean- Returns:
true
if the endpoint is exposed
getEndpointType
protected Class<? extends E> getEndpointType()
createEndpoint
protected abstract E createEndpoint(Object endpointBean, EndpointId id, boolean enabledByDefault, Collection<O> operations)
Factory method called to create theendpoint
.- Parameters:
endpointBean
- the source endpoint beanid
- the ID of the endpointenabledByDefault
- if the endpoint is enabled by defaultoperations
- the endpoint operations- Returns:
- a created endpoint (a
DiscoveredEndpoint
is recommended)
createOperation
protected abstract O createOperation(EndpointId endpointId, DiscoveredOperationMethod operationMethod, OperationInvoker invoker)
Factory method to create anendpoint operation
.- Parameters:
endpointId
- the endpoint idoperationMethod
- the operation methodinvoker
- the invoker to use- Returns:
- a created operation
createOperationKey
protected abstract EndpointDiscoverer.OperationKey createOperationKey(O operation)
Create anEndpointDiscoverer.OperationKey
for the given operation.- Parameters:
operation
- the source operation- Returns:
- the operation key