|
|
@ -113,9 +113,6 @@ class OnAvailableEndpointCondition extends SpringBootCondition {
|
|
|
|
if (!enablementOutcome.isMatch()) {
|
|
|
|
if (!enablementOutcome.isMatch()) {
|
|
|
|
return enablementOutcome;
|
|
|
|
return enablementOutcome;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (CloudPlatform.CLOUD_FOUNDRY.isActive(environment)) {
|
|
|
|
|
|
|
|
return ConditionOutcome.match(message.because("application is running on Cloud Foundry"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Set<EndpointExposure> exposuresToCheck = getExposuresToCheck(conditionAnnotation);
|
|
|
|
Set<EndpointExposure> exposuresToCheck = getExposuresToCheck(conditionAnnotation);
|
|
|
|
Set<ExposureFilter> exposureFilters = getExposureFilters(environment);
|
|
|
|
Set<ExposureFilter> exposureFilters = getExposureFilters(environment);
|
|
|
|
for (ExposureFilter exposureFilter : exposureFilters) {
|
|
|
|
for (ExposureFilter exposureFilter : exposureFilters) {
|
|
|
@ -168,6 +165,9 @@ class OnAvailableEndpointCondition extends SpringBootCondition {
|
|
|
|
if (environment.getProperty(JMX_ENABLED_KEY, Boolean.class, false)) {
|
|
|
|
if (environment.getProperty(JMX_ENABLED_KEY, Boolean.class, false)) {
|
|
|
|
exposureFilters.add(new ExposureFilter(environment, EndpointExposure.JMX));
|
|
|
|
exposureFilters.add(new ExposureFilter(environment, EndpointExposure.JMX));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CloudPlatform.CLOUD_FOUNDRY.isActive(environment)) {
|
|
|
|
|
|
|
|
exposureFilters.add(new ExposureFilter(environment, EndpointExposure.CLOUD_FOUNDRY));
|
|
|
|
|
|
|
|
}
|
|
|
|
exposureFilters.add(new ExposureFilter(environment, EndpointExposure.WEB));
|
|
|
|
exposureFilters.add(new ExposureFilter(environment, EndpointExposure.WEB));
|
|
|
|
exposureFiltersCache.put(environment, exposureFilters);
|
|
|
|
exposureFiltersCache.put(environment, exposureFilters);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -181,9 +181,16 @@ class OnAvailableEndpointCondition extends SpringBootCondition {
|
|
|
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
|
|
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
|
|
|
private ExposureFilter(Environment environment, EndpointExposure exposure) {
|
|
|
|
private ExposureFilter(Environment environment, EndpointExposure exposure) {
|
|
|
|
super((Class) ExposableEndpoint.class, environment,
|
|
|
|
super((Class) ExposableEndpoint.class, environment,
|
|
|
|
"management.endpoints." + exposure.name().toLowerCase() + ".exposure",
|
|
|
|
"management.endpoints." + getCanonicalName(exposure) + ".exposure", exposure.getDefaultIncludes());
|
|
|
|
exposure.getDefaultIncludes());
|
|
|
|
|
|
|
|
this.exposure = exposure;
|
|
|
|
this.exposure = exposure;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String getCanonicalName(EndpointExposure exposure) {
|
|
|
|
|
|
|
|
if (EndpointExposure.CLOUD_FOUNDRY.equals(exposure)) {
|
|
|
|
|
|
|
|
return "cloud-foundry";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return exposure.name().toLowerCase();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EndpointExposure getExposure() {
|
|
|
|
EndpointExposure getExposure() {
|
|
|
|