juanpablo-santos commented on code in PR #362:
URL: https://github.com/apache/jspwiki/pull/362#discussion_r1777776511


##########
jspwiki-cache/src/main/java/org/apache/wiki/cache/CachingManager.java:
##########
@@ -121,4 +122,12 @@ public interface CachingManager {
      */
     void remove( String cacheName, Serializable key );
 
+    /**
+     * Register a listener to a cache
+     *
+     * @param cacheName The cache to which the listener should be registered
+     * @param listener cache listener to register
+     * @return true if the listener is being added and was not already added
+     */
+    boolean registerListener( String cacheName, CacheEventListener listener );

Review Comment:
   Hi!
   
   I thought of throwing an event too, but given that one class is a direct 
dependency of the other, it seemed too much indirection to me. I agree that 
updateAllRequestedFlag is also too specific. May be something like 
`registerListener( String cacheName, String listener, T... args)`? `listener` 
could be used to decide which kind of listener build for a given `cacheName`, 
with all the required data passed through `args`. WDYT? 
   
   Either going the events way or going through the registerListener method 
would fine to me, my main concern is that EhCache classes should not appear 
outside `EhcacheCachingManager`
   
   cheers,
   juan pablo



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jspwiki.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to