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 type
O - 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 for EndpointsSupplier implementations that discover @Endpoint beans and @EndpointExtension beans in an application context.
Since:
2.0.0
Author:
Andy Wilkinson, Stephane Nicoll, Phillip Webb
  • Constructor Details

  • Method Details

    • getEndpoints

      public final Collection<E> getEndpoints()
      Description copied from interface: EndpointsSupplier
      Return the provided endpoints.
      Specified by:
      getEndpoints in interface EndpointsSupplier<E extends ExposableEndpoint<O>>
      Returns:
      the endpoints
    • isExtensionTypeExposed

      protected boolean isExtensionTypeExposed(Class<?> extensionBeanType)
      Determine if an extension bean should be exposed. Subclasses can override this method to provide additional logic.
      Parameters:
      extensionBeanType - the extension bean type
      Returns:
      true if the extension is exposed
    • isEndpointTypeExposed

      protected boolean isEndpointTypeExposed(Class<?> beanType)
      Determine if an endpoint bean should be exposed. Subclasses can override this method to provide additional logic.
      Parameters:
      beanType - the endpoint bean type
      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 the endpoint.
      Parameters:
      endpointBean - the source endpoint bean
      id - the ID of the endpoint
      enabledByDefault - if the endpoint is enabled by default
      operations - 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 an endpoint operation.
      Parameters:
      endpointId - the endpoint id
      operationMethod - the operation method
      invoker - the invoker to use
      Returns:
      a created operation
    • createOperationKey

      protected abstract EndpointDiscoverer.OperationKey createOperationKey(O operation)
      Create an EndpointDiscoverer.OperationKey for the given operation.
      Parameters:
      operation - the source operation
      Returns:
      the operation key