Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
<description>Unified caching library providing standardized cache abstractions with Caffeine and Redis implementations</description>

<dependencies>
<!-- Firefly Kernel (exception hierarchy, shared abstractions) -->
<dependency>
<groupId>org.fireflyframework</groupId>
<artifactId>fireflyframework-kernel</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Spring Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package org.fireflyframework.cache.annotation;

import org.fireflyframework.cache.config.CacheAutoConfiguration;
import org.springframework.context.annotation.Import;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -31,6 +28,10 @@
* support for Firefly cache annotations like {@link Cacheable}, {@link CacheEvict},
* and {@link CachePut}.
* <p>
* Note: The actual auto-configuration is registered via
* {@code META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports}.
* This annotation serves as a marker only.
* <p>
* Example usage:
* <pre>
* &#64;Configuration
Expand All @@ -42,7 +43,6 @@
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Import(CacheAutoConfiguration.class)
public @interface EnableCaching {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Primary;
import org.springframework.scheduling.annotation.EnableAsync;

Expand Down Expand Up @@ -61,7 +60,6 @@
@AutoConfiguration
@ConditionalOnProperty(prefix = "firefly.cache", name = "enabled", havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(CacheProperties.class)
@ComponentScan(basePackages = "org.fireflyframework.cache")
@EnableAsync
@Slf4j
public class CacheAutoConfiguration {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package org.fireflyframework.cache.exception;

import org.fireflyframework.kernel.exception.FireflyInfrastructureException;

/**
* Base exception for all cache-related errors.
*
* @author Firefly Team
* @since 1.0.0
*/
public class CacheException extends RuntimeException {
public class CacheException extends FireflyInfrastructureException {

public CacheException(String message) {
super(message);
Expand All @@ -17,6 +19,6 @@ public CacheException(String message, Throwable cause) {
}

public CacheException(Throwable cause) {
super(cause);
super(cause.getMessage(), cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

package org.fireflyframework.cache.serialization;

import org.fireflyframework.cache.exception.CacheException;

/**
* Exception thrown when cache serialization or deserialization fails.
*/
public class SerializationException extends RuntimeException {
public class SerializationException extends CacheException {

public SerializationException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CacheAutoConfigurationRedisIntegrationTest {
.withReuse(true);

private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(CacheAutoConfiguration.class));
.withConfiguration(AutoConfigurations.of(CacheAutoConfiguration.class, RedisCacheAutoConfiguration.class));

@Test
void shouldCreateRedisBeansWhenRedisIsConfigured() {
Expand Down