A unified toolkit created for caching operations, using a unified program interface to complete the invocation of different caching services.
Redis Client: Jedis 5.1.1, Lettuce 6.3.1.RELEASE, Redisson 3.26.0
Memcached Client: Xmemcached 2.4.8
Compile:OpenJDK 11
Runtime: OpenJDK 11+ or compatible version
Features Freeze: 31, Dec, 2026
Secure Patch: 31, Dec, 2029
If developers need all client support:
<dependency>
<groupId>org.nervousync</groupId>
<artifactId>cache-nodeps-jdk11</artifactId>
<version>${version}</version>
</dependency>
If developers need special client support:
<!-- Cache manager implements class -->
<dependency>
<groupId>org.nervousync</groupId>
<artifactId>cache-core-jdk11</artifactId>
<version>${version}</version>
</dependency>
<!-- Jedis client support -->
<dependency>
<groupId>org.nervousync</groupId>
<artifactId>cache-jedis-jdk11</artifactId>
<version>${version}</version>
</dependency>
<!-- Lettuce client support -->
<dependency>
<groupId>org.nervousync</groupId>
<artifactId>cache-lettuce-jdk11</artifactId>
<version>${version}</version>
</dependency>
<!-- Redisson client support -->
<dependency>
<groupId>org.nervousync</groupId>
<artifactId>cache-redisson-jdk11</artifactId>
<version>${version}</version>
</dependency>
<!-- Xmemcached client support -->
<dependency>
<groupId>org.nervousync</groupId>
<artifactId>cache-xmemcached-jdk11</artifactId>
<version>${version}</version>
</dependency>
Program developers obtain the cache manager instance object by calling the getInstance static method of org.nervousync.cache.CacheUtils. When obtaining the cache manager instance object, if the cache manager has not been initialized, the toolkit will automatically perform the initialization work and search for the existing cache manager implementation class through Java's SPI mechanism. If the cache manager implementation class is not found, it will throw Exception information appears. During the initialization process, the system's default cache configuration information is also read and registered through the configuration file manager.
Program developers call the register method of the org.nervousync.cache.CacheUtils instance object and pass in the cache name as the parameter. The system uses the configuration file manager to read the cache configuration information of the given cache name and registers it using the read configuration information. Initialize the cache, and the register method returns the registration result of the boolean type.
Program developers obtain the cache server operation client by calling the client method of the org.nervousync.cache.CacheUtils instance object, passing in the cache name as the parameter. Returns null if the cache name is not registered.
Program developers can customize the cache manager to implement the customized cache client manager they need. The specific method is:
- Create a cache client manager implementation class and implement the org.nervousync.cache.api.CacheManager interface.
- Create the /META-INF/services/org.nervousync.cache.api.CacheManager file and write the complete name of the implementation class (package name + class name) in the file.
Notice: If there are multiple cache client manager implementation classes in the entire project, the system will select the first implementation class based on the loading order.
Friends are welcome to translate the prompt information, error messages,
etc. in this document and project into more languages to help more users better understand and use this toolkit.
If you find problems during use or need to improve or add related functions, please submit an issue to this project
or send email to [email protected]
For better communication, please include the following information when submitting an issue or sending an email:
- The purpose is: discover bugs/function improvements/add new features
- Please paste the following information (if it exists): incoming data, expected results, error stack information
- Where do you think there may be a problem with the code (if provided, it can help us find and solve the problem as soon as possible)
If you are submitting information about adding new features, please ensure that the features to be added are general needs, that is, the new features can help most users.
If you need to add customized special requirements, I will charge a certain custom development fee.
The specific fee amount will be assessed based on the workload of the customized special requirements.
For customized special features, please send an email directly to [email protected]. At the same time, please try to indicate the budget amount of development cost you can afford in the email.