If a component is solely used in the context of an endpoint, there is no easy way to make it available only said component is enabled. The main reason behind that is that the logic in @ConditionalOnEnabledEndpoint requires the return type to be an endpoint (or an extension).