[
https://issues.apache.org/jira/browse/KARAF-6017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17624538#comment-17624538
]
ASF GitHub Bot commented on KARAF-6017:
---------------------------------------
awrb commented on code in PR #1677:
URL: https://github.com/apache/karaf/pull/1677#discussion_r1005818633
##########
cache/commands/src/main/java/org/apache/karaf/cache/core/commands/Invalidate.java:
##########
@@ -0,0 +1,28 @@
+package org.apache.karaf.cache.core.commands;
+
+import org.apache.karaf.cache.api.CacheService;
+import org.apache.karaf.cache.core.commands.completers.CacheNameCompleter;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+
+@Service
+@Command(scope = "cache", name = "invalidate", description = "")
+public class Invalidate implements Action {
+
+ @Reference
+ CacheService cacheService;
+
+ @Argument(index = 0, required = true)
+ @Completion(CacheNameCompleter.class)
+ String cacheName;
+
+ @Override
+ public Object execute() throws Exception {
+ cacheService.invalidateCache(cacheName);
+ return cacheService + " invalidated";
Review Comment:
Should be `cacheName + " invalidated";`
> Provide cache service
> ---------------------
>
> Key: KARAF-6017
> URL: https://issues.apache.org/jira/browse/KARAF-6017
> Project: Karaf
> Issue Type: New Feature
> Components: karaf
> Reporter: Jean-Baptiste Onofré
> Priority: Major
>
> Similar to the scheduler feature we have in Karaf (façading quartz), we could
> provide a cache service (façading ehcache).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)