Move code from spring-boot-actuator to spring-boot-cache
This commit is contained in:
committed by
Phillip Webb
parent
302a4212b5
commit
adec7f2df2
@@ -20,13 +20,13 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.SimpleAutowireCandidateResolver;
|
||||
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
|
||||
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.EndpointExposure;
|
||||
import org.springframework.boot.actuate.cache.CachesEndpoint;
|
||||
import org.springframework.boot.actuate.cache.CachesEndpointWebExtension;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpoint;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpointWebExtension;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.context.annotation.Bean;
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@AutoConfiguration(afterName = "org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration")
|
||||
@ConditionalOnClass(CacheManager.class)
|
||||
@ConditionalOnClass({ CacheManager.class, CachesEndpoint.class })
|
||||
@ConditionalOnAvailableEndpoint(CachesEndpoint.class)
|
||||
public class CachesEndpointAutoConfiguration {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,13 +23,13 @@ import org.cache2k.Cache2kBuilder;
|
||||
import org.cache2k.extra.micrometer.Cache2kCacheMetrics;
|
||||
import org.cache2k.extra.spring.SpringCache2kCache;
|
||||
|
||||
import org.springframework.boot.actuate.metrics.cache.Cache2kCacheMeterBinderProvider;
|
||||
import org.springframework.boot.actuate.metrics.cache.CacheMeterBinderProvider;
|
||||
import org.springframework.boot.actuate.metrics.cache.CaffeineCacheMeterBinderProvider;
|
||||
import org.springframework.boot.actuate.metrics.cache.HazelcastCacheMeterBinderProvider;
|
||||
import org.springframework.boot.actuate.metrics.cache.JCacheCacheMeterBinderProvider;
|
||||
import org.springframework.boot.actuate.metrics.cache.RedisCacheMeterBinderProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.cache.actuate.metrics.Cache2kCacheMeterBinderProvider;
|
||||
import org.springframework.boot.cache.actuate.metrics.CacheMeterBinderProvider;
|
||||
import org.springframework.boot.cache.actuate.metrics.CaffeineCacheMeterBinderProvider;
|
||||
import org.springframework.boot.cache.actuate.metrics.HazelcastCacheMeterBinderProvider;
|
||||
import org.springframework.boot.cache.actuate.metrics.JCacheCacheMeterBinderProvider;
|
||||
import org.springframework.boot.cache.actuate.metrics.RedisCacheMeterBinderProvider;
|
||||
import org.springframework.cache.caffeine.CaffeineCache;
|
||||
import org.springframework.cache.jcache.JCacheCache;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -42,7 +42,7 @@ import org.springframework.data.redis.cache.RedisCache;
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(MeterBinder.class)
|
||||
@ConditionalOnClass({ MeterBinder.class, CacheMeterBinderProvider.class })
|
||||
class CacheMeterBinderProvidersConfiguration {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
@@ -20,6 +20,8 @@ import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfigu
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.cache.actuate.metrics.CacheMetricsRegistrar;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.context.annotation.Import;
|
||||
@@ -34,6 +36,7 @@ import org.springframework.context.annotation.Import;
|
||||
@AutoConfiguration(after = MetricsAutoConfiguration.class,
|
||||
afterName = "org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration")
|
||||
@ConditionalOnBean(CacheManager.class)
|
||||
@ConditionalOnClass(CacheMetricsRegistrar.class)
|
||||
@Import({ CacheMeterBinderProvidersConfiguration.class, CacheMetricsRegistrarConfiguration.class })
|
||||
public class CacheMetricsAutoConfiguration {
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ import io.micrometer.core.instrument.Tag;
|
||||
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.SimpleAutowireCandidateResolver;
|
||||
import org.springframework.boot.actuate.metrics.cache.CacheMeterBinderProvider;
|
||||
import org.springframework.boot.actuate.metrics.cache.CacheMetricsRegistrar;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.cache.actuate.metrics.CacheMeterBinderProvider;
|
||||
import org.springframework.boot.cache.actuate.metrics.CacheMetricsRegistrar;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,9 +18,9 @@ package org.springframework.boot.actuate.autoconfigure.cache;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.cache.CachesEndpoint;
|
||||
import org.springframework.boot.actuate.cache.CachesEndpointWebExtension;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpoint;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpointWebExtension;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
import org.springframework.cache.CacheManager;
|
||||
|
||||
|
||||
@@ -7,8 +7,9 @@ description = "Spring Boot Actuator Docs"
|
||||
|
||||
dependencies {
|
||||
testImplementation(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-http-converter"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-cache"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-flyway"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-http-converter"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-integration"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-jackson"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-jdbc"))
|
||||
|
||||
@@ -23,9 +23,9 @@ import java.util.Map;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.cache.CachesEndpoint;
|
||||
import org.springframework.boot.actuate.cache.CachesEndpointWebExtension;
|
||||
import org.springframework.boot.actuate.docs.MockMvcEndpointDocumentationTests;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpoint;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpointWebExtension;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
plugins {
|
||||
id "java-library"
|
||||
id "java-test-fixtures"
|
||||
id "org.springframework.boot.configuration-properties"
|
||||
id "org.springframework.boot.optional-dependencies"
|
||||
id "org.springframework.boot.docker-test"
|
||||
@@ -12,7 +13,6 @@ dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-cache"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-neo4j"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
|
||||
@@ -60,8 +60,6 @@ dependencies {
|
||||
optional("javax.cache:cache-api")
|
||||
optional("org.apache.tomcat.embed:tomcat-embed-core")
|
||||
optional("org.aspectj:aspectjweaver")
|
||||
optional("org.cache2k:cache2k-micrometer")
|
||||
optional("org.cache2k:cache2k-spring")
|
||||
optional("org.eclipse.angus:angus-mail")
|
||||
optional("org.eclipse.jetty:jetty-server") {
|
||||
exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api")
|
||||
@@ -94,6 +92,17 @@ dependencies {
|
||||
optional("org.springframework.security:spring-security-web")
|
||||
optional("org.springframework.session:spring-session-core")
|
||||
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-http-converter"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-jackson"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-jersey"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-reactor-netty"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-webflux"))
|
||||
testFixturesImplementation(project(":spring-boot-project:spring-boot-webmvc"))
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-hazelcast"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-jackson"))
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.endpoint.web.test;
|
||||
|
||||
public class PortHolder {
|
||||
|
||||
private int port;
|
||||
|
||||
int getPort() {
|
||||
return this.port;
|
||||
}
|
||||
|
||||
void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -326,4 +326,18 @@ class WebEndpointTestInvocationContextProvider implements TestTemplateInvocation
|
||||
|
||||
}
|
||||
|
||||
private static final class PortHolder {
|
||||
|
||||
private int port;
|
||||
|
||||
private int getPort() {
|
||||
return this.port;
|
||||
}
|
||||
|
||||
private void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ plugins {
|
||||
id "org.springframework.boot.auto-configuration"
|
||||
id "org.springframework.boot.configuration-properties"
|
||||
id "org.springframework.boot.deployed"
|
||||
id "org.springframework.boot.docker-test"
|
||||
id "org.springframework.boot.optional-dependencies"
|
||||
}
|
||||
|
||||
@@ -12,14 +13,17 @@ dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
api("org.springframework:spring-context-support")
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-actuator"))
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-data-couchbase"))
|
||||
optional(project(":spring-boot-project:spring-boot-data-redis"))
|
||||
optional(project(":spring-boot-project:spring-boot-hazelcast"))
|
||||
optional(project(":spring-boot-project:spring-boot-jpa"))
|
||||
optional("com.hazelcast:hazelcast-spring")
|
||||
optional("org.cache2k:cache2k-spring")
|
||||
optional("io.micrometer:micrometer-core")
|
||||
optional("javax.cache:cache-api")
|
||||
optional("org.cache2k:cache2k-micrometer")
|
||||
optional("org.cache2k:cache2k-spring")
|
||||
optional("org.ehcache:ehcache") {
|
||||
artifact {
|
||||
classifier = 'jakarta'
|
||||
@@ -33,8 +37,15 @@ dependencies {
|
||||
optional("org.infinispan:infinispan-jcache")
|
||||
optional("org.infinispan:infinispan-spring6-embedded")
|
||||
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
|
||||
dockerTestImplementation("com.redis:testcontainers-redis")
|
||||
dockerTestImplementation("org.testcontainers:junit-jupiter")
|
||||
dockerTestImplementation("org.testcontainers:testcontainers")
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-actuator")))
|
||||
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
|
||||
|
||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.BiConsumer;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.cache;
|
||||
package org.springframework.boot.cache.actuate.endpoint;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -36,7 +36,7 @@ import org.springframework.cache.CacheManager;
|
||||
*
|
||||
* @author Johannes Edmeier
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.1.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
@Endpoint(id = "caches")
|
||||
public class CachesEndpoint {
|
||||
@@ -14,21 +14,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.cache;
|
||||
package org.springframework.boot.cache.actuate.endpoint;
|
||||
|
||||
import org.springframework.boot.actuate.cache.CachesEndpoint.CacheEntryDescriptor;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.DeleteOperation;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.OptionalParameter;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.Selector;
|
||||
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
|
||||
import org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExtension;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpoint.CacheEntryDescriptor;
|
||||
|
||||
/**
|
||||
* {@link EndpointWebExtension @EndpointWebExtension} for the {@link CachesEndpoint}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.1.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
@EndpointWebExtension(endpoint = CachesEndpoint.class)
|
||||
public class CachesEndpointWebExtension {
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.cache;
|
||||
package org.springframework.boot.cache.actuate.endpoint;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -23,7 +23,7 @@ import java.util.Collections;
|
||||
* Exception thrown when multiple caches exist with the same name.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.1.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class NonUniqueCacheException extends RuntimeException {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,6 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Actuator support for cache metrics.
|
||||
* Actuator endpoint for caches.
|
||||
*/
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.endpoint;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
import io.micrometer.core.instrument.binder.MeterBinder;
|
||||
@@ -25,7 +25,7 @@ import org.cache2k.extra.spring.SpringCache2kCache;
|
||||
* {@link CacheMeterBinderProvider} implementation for cache2k.
|
||||
*
|
||||
* @author Jens Wilke
|
||||
* @since 2.7.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class Cache2kCacheMeterBinderProvider implements CacheMeterBinderProvider<SpringCache2kCache> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
import io.micrometer.core.instrument.binder.MeterBinder;
|
||||
@@ -26,7 +26,7 @@ import org.springframework.cache.Cache;
|
||||
*
|
||||
* @param <C> the cache type
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.0.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface CacheMeterBinderProvider<C extends Cache> {
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
@@ -33,7 +33,7 @@ import org.springframework.util.ClassUtils;
|
||||
* Register supported {@link Cache} to a {@link MeterRegistry}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.0.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class CacheMetricsRegistrar {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
import io.micrometer.core.instrument.binder.MeterBinder;
|
||||
@@ -26,7 +26,7 @@ import org.springframework.cache.caffeine.CaffeineCache;
|
||||
* {@link CacheMeterBinderProvider} implementation for Caffeine.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.0.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class CaffeineCacheMeterBinderProvider implements CacheMeterBinderProvider<CaffeineCache> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -27,7 +27,7 @@ import io.micrometer.core.instrument.binder.cache.HazelcastCacheMetrics;
|
||||
import org.springframework.aot.hint.ExecutableMode;
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||
import org.springframework.boot.actuate.metrics.cache.HazelcastCacheMeterBinderProvider.HazelcastCacheMeterBinderProviderRuntimeHints;
|
||||
import org.springframework.boot.cache.actuate.metrics.HazelcastCacheMeterBinderProvider.HazelcastCacheMeterBinderProviderRuntimeHints;
|
||||
import org.springframework.context.annotation.ImportRuntimeHints;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
@@ -36,7 +36,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* {@link CacheMeterBinderProvider} implementation for Hazelcast.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.0.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
@ImportRuntimeHints(HazelcastCacheMeterBinderProviderRuntimeHints.class)
|
||||
public class HazelcastCacheMeterBinderProvider implements CacheMeterBinderProvider<HazelcastCache> {
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
import io.micrometer.core.instrument.binder.MeterBinder;
|
||||
@@ -26,7 +26,7 @@ import org.springframework.cache.jcache.JCacheCache;
|
||||
* {@link CacheMeterBinderProvider} implementation for JCache.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.0.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class JCacheCacheMeterBinderProvider implements CacheMeterBinderProvider<JCacheCache> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
import io.micrometer.core.instrument.binder.MeterBinder;
|
||||
@@ -25,7 +25,7 @@ import org.springframework.data.redis.cache.RedisCache;
|
||||
* {@link CacheMeterBinderProvider} implementation for Redis.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.4.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class RedisCacheMeterBinderProvider implements CacheMeterBinderProvider<RedisCache> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.data.redis.cache.RedisCache;
|
||||
* {@link CacheMeterBinder} for {@link RedisCache}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.4.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public class RedisCacheMetrics extends CacheMeterBinder<RedisCache> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,6 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Actuator support for caches.
|
||||
* Metrics for caches.
|
||||
*/
|
||||
package org.springframework.boot.actuate.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.cache;
|
||||
package org.springframework.boot.cache.actuate.endpoint;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -24,8 +24,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.cache.CachesEndpoint.CacheEntryDescriptor;
|
||||
import org.springframework.boot.actuate.cache.CachesEndpoint.CacheManagerDescriptor;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpoint.CacheEntryDescriptor;
|
||||
import org.springframework.boot.cache.actuate.endpoint.CachesEndpoint.CacheManagerDescriptor;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.cache;
|
||||
package org.springframework.boot.cache.actuate.endpoint;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
|
||||
import org.springframework.boot.actuate.metrics.cache.HazelcastCacheMeterBinderProvider.HazelcastCacheMeterBinderProviderRuntimeHints;
|
||||
import org.springframework.boot.cache.actuate.metrics.HazelcastCacheMeterBinderProvider.HazelcastCacheMeterBinderProviderRuntimeHints;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.metrics.cache;
|
||||
package org.springframework.boot.cache.actuate.metrics;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
Reference in New Issue
Block a user