Jc2
JCache Configurator for Java EE 7
Install / Use
/learn @AdamBien/Jc2README
jc2
JCache Configurator for Java EE 7
Installation
<dependency>
<groupId>com.airhacks</groupId>
<artifactId>jc2</artifactId>
<version>0.0.2</version>
</dependency>
Usage
package com.airhacks.jc2.boundary;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@Path("hello")
public class HelloResource {
@Inject
String greeting;
@GET
public String hello() {
return greeting;
}
}
The key com.airhacks.jc2.boundary.HelloResource.greeting is resolved in the cache named: configuration
Customization
An initial set of value can be preloaded and merged by exposing a Map<String,String> like e.g.:
import java.util.HashMap;
import java.util.Map;
import javax.enterprise.inject.Produces;
public class InitialConfiguration {
@Produces
public Map<String, String> get() {
Map<String, String> cache = new HashMap<>();
cache.put("com.airhacks.jc2.boundary.HelloResource.greeting", "hey duke");
return cache;
}
}
Administration
headlands exposes JCache API as a REST service and also uses Hazelcast as an SPI. Deploy headlands and use the cache with the name configuration to maintain the contents.
Related Skills
node-connect
340.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.1kCommit, push, and open a PR
