Skip to content

Commit b3a7c53

Browse files
committed
feat: reactify-core
1 parent c65e753 commit b3a7c53

File tree

123 files changed

+676
-3489
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+676
-3489
lines changed

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
<module>reactify-core</module>
9494
<module>reactify-utils</module>
9595
<module>reactify-cache</module>
96-
<module>reactify-tracelog</module>
9796
</modules>
9897

9998
<dependencies>

reactify-cache/src/main/java/com/reactify/cache/ApplicationContextProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.reactify.cache;
1817

1918
import org.springframework.beans.BeansException;

reactify-cache/src/main/java/com/reactify/cache/CacheAspect.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.reactify.cache;
1817

1918
import com.github.benmanes.caffeine.cache.Cache;

reactify-cache/src/main/java/com/reactify/cache/CacheStore.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.reactify.cache;
1817

1918
import com.github.benmanes.caffeine.cache.Cache;

reactify-cache/src/main/java/com/reactify/cache/CacheUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.reactify.cache;
1817

1918
import java.lang.reflect.Method;

reactify-cache/src/main/java/com/reactify/cache/CustomizeRemovalListener.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.reactify.cache;
1817

1918
import com.github.benmanes.caffeine.cache.RemovalCause;

reactify-cache/src/main/java/com/reactify/cache/LocalCache.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package com.reactify.cache;
1817

1918
import java.lang.annotation.ElementType;

reactify-core/pom.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
<version>3.3.5</version>
99
<relativePath/>
1010
</parent>
11-
<groupId>com.ezbuy.platform</groupId>
11+
<groupId>io.github.hoangtien2k3</groupId>
1212
<artifactId>reactify-core</artifactId>
13-
<version>1.0-SNAPSHOT</version>
14-
<name>reactify-core</name>
15-
<description>Java library for developing backend with reactive programming</description>
13+
<version>1.1.7</version>
14+
<name>reactify-cache</name>
15+
<packaging>jar</packaging>
16+
<description>Java lib using caffeine cache</description>
1617
<url>https://github.com/hoangtien2k3/reactify</url>
18+
1719
<licenses>
1820
<license>
1921
<name>Apache License, Version 2.0</name>
@@ -43,6 +45,7 @@
4345
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
4446
</repository>
4547
</distributionManagement>
48+
4649
<properties>
4750
<revision>1.0-SNAPSHOT</revision>
4851
<java.version>21</java.version>
@@ -71,6 +74,7 @@
7174
<sonar.organization>hoangtien2k3</sonar.organization>
7275
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
7376
</properties>
77+
7478
<dependencyManagement>
7579
<dependencies>
7680
<dependency>
@@ -82,6 +86,7 @@
8286
</dependency>
8387
</dependencies>
8488
</dependencyManagement>
89+
8590
<dependencies>
8691
<dependency>
8792
<groupId>org.springframework.boot</groupId>
@@ -237,6 +242,7 @@
237242
<version>${modelmapper.version}</version>
238243
</dependency>
239244
</dependencies>
245+
240246
<build>
241247
<plugins>
242248
<plugin>
@@ -388,4 +394,5 @@
388394
</plugin>
389395
</plugins>
390396
</build>
397+
391398
</project>

reactify-core/src/main/java/com/reactify/annotations/cache/CacheAspect.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
package com.reactify.annotations.cache;
1717

1818
import com.github.benmanes.caffeine.cache.Cache;
19+
import java.util.Objects;
20+
import java.util.Optional;
1921
import lombok.extern.slf4j.Slf4j;
2022
import org.aspectj.lang.ProceedingJoinPoint;
2123
import org.aspectj.lang.annotation.Around;
@@ -28,9 +30,6 @@
2830
import reactor.core.publisher.Mono;
2931
import reactor.core.publisher.Signal;
3032

31-
import java.util.Objects;
32-
import java.util.Optional;
33-
3433
/**
3534
* <p>
3635
* The {@code CacheAspect} class provides caching functionality for methods
@@ -47,10 +46,10 @@
4746
* </p>
4847
*
4948
* <p>
50-
* The class is annotated with {@link Aspect} and
51-
* {@link Configuration}, making it a
49+
* The class is annotated with {@link org.aspectj.lang.annotation.Aspect} and
50+
* {@link org.springframework.context.annotation.Configuration}, making it a
5251
* Spring managed bean that can intercept method calls. The logging is managed
53-
* using the Lombok {@link Slf4j} annotation.
52+
* using the Lombok {@link lombok.extern.slf4j.Slf4j} annotation.
5453
* </p>
5554
*
5655
* @author hoangtien2k3
@@ -84,11 +83,11 @@ private void processAnnotation() {}
8483
* </p>
8584
*
8685
* @param joinPoint
87-
* a {@link ProceedingJoinPoint} object representing
86+
* a {@link org.aspectj.lang.ProceedingJoinPoint} object representing
8887
* the method execution context.
89-
* @return an {@link Object} that is the result of the method
88+
* @return an {@link java.lang.Object} that is the result of the method
9089
* execution or the cached result.
91-
* @throws Throwable
90+
* @throws java.lang.Throwable
9291
* if any exception occurs during method execution or while
9392
* accessing the cache.
9493
*/

reactify-core/src/main/java/com/reactify/annotations/cache/CacheStore.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
import com.github.benmanes.caffeine.cache.Caffeine;
2020
import com.github.benmanes.caffeine.cache.Scheduler;
2121
import com.reactify.annotations.LocalCache;
22+
import java.lang.reflect.Method;
23+
import java.time.Duration;
24+
import java.util.HashMap;
25+
import java.util.HashSet;
26+
import java.util.Set;
27+
import javax.annotation.PostConstruct;
2228
import lombok.extern.slf4j.Slf4j;
2329
import org.reflections.Reflections;
2430
import org.reflections.scanners.Scanners;
@@ -31,25 +37,18 @@
3137
import org.springframework.scheduling.annotation.Async;
3238
import org.springframework.stereotype.Component;
3339

34-
import javax.annotation.PostConstruct;
35-
import java.lang.reflect.Method;
36-
import java.time.Duration;
37-
import java.util.HashMap;
38-
import java.util.HashSet;
39-
import java.util.Set;
40-
4140
/**
4241
* <p>
4342
* The {@code CacheStore} class is responsible for managing and initializing
4443
* caches for methods annotated with
45-
* {@link LocalCache}. It uses the Caffeine caching
44+
* {@link com.reactify.annotations.LocalCache}. It uses the Caffeine caching
4645
* library to provide an efficient caching mechanism, supporting features like
4746
* auto-loading of cache entries based on method annotations.
4847
* </p>
4948
*
5049
* <p>
5150
* This class implements
52-
* {@link ApplicationContextAware} to gain access to
51+
* {@link org.springframework.context.ApplicationContextAware} to gain access to
5352
* the Spring application context, allowing it to dynamically discover and
5453
* initialize caches at startup. It automatically loads caches for methods that
5554
* have the {@code @LocalCache} annotation and meet the specified criteria.
@@ -69,7 +68,7 @@
6968
* </p>
7069
*
7170
* <p>
72-
* The caches are stored in a static {@link HashMap} for easy access
71+
* The caches are stored in a static {@link java.util.HashMap} for easy access
7372
* based on the method name and class.
7473
* </p>
7574
*
@@ -136,8 +135,8 @@ private static void init() {
136135
* </p>
137136
*
138137
* @param key
139-
* a {@link String} object representing the cache name.
140-
* @return a {@link Cache} object
138+
* a {@link java.lang.String} object representing the cache name.
139+
* @return a {@link com.github.benmanes.caffeine.cache.Cache} object
141140
* corresponding to the specified name, or {@code null} if no cache
142141
* exists for the given key.
143142
*/
@@ -149,11 +148,11 @@ public static Cache<Object, Object> getCache(String key) {
149148
* <p>
150149
* Automatically loads cache entries for methods that are configured to
151150
* auto-load. This method is triggered by the
152-
* {@link ContextRefreshedEvent}.
151+
* {@link org.springframework.context.event.ContextRefreshedEvent}.
153152
* </p>
154153
*
155154
* @param event
156-
* a {@link ContextRefreshedEvent}
155+
* a {@link org.springframework.context.event.ContextRefreshedEvent}
157156
* object indicating the application context has been refreshed.
158157
*/
159158
@Async

0 commit comments

Comments
 (0)