Skip to content

Commit

Permalink
updated JavaDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdereg committed Jun 23, 2024
1 parent 274fed2 commit 8973e68
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/main/java/com/cedarsoftware/util/LRUCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,16 @@ public LRUCache(int capacity, StrategyType strategyType) {
* <p>
* Note: There is a "shutdown" method on LRUCache to ensure that the default scheduler that was created for you
* is cleaned up, which is useful in a container environment. If you supplied your own scheduler and cleanupPool,
* then it is up to you to manage there termination. The shutdown() method will not manipulate them in anyway.
* then it is up to you to manage their termination. The shutdown() method will not manipulate them in any way.
* @param capacity int maximum number of entries in the cache.
* @param cleanupDelayMillis int number of milliseconds after a put() call when a scheduled task should run to
* trim the cache to no more than capacity. The default is 10ms.
* @param scheduler ScheduledExecutorService which can be null, in which case one will be created for you, or you
* can supply your own.
* @param cleanupPool ForkJoinPool can be null, in which case one will be created for you, you can supply your own.
* can supply your own. If one is created for you, when shutdown() is called, it will be shuwdown
* for you.
* @param cleanupPool ForkJoinPool can be null, in which case the common ForkJoinPool will be used, or you can
* supply your own. It will not be terminated when shutdown() is called regardless of whether
* it was supplied or the common ForkJoinPool was used.
* @see com.cedarsoftware.util.cache.ThreadedLRUCacheStrategy
*/
public LRUCache(int capacity, int cleanupDelayMillis, ScheduledExecutorService scheduler, ForkJoinPool cleanupPool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ void updateTimestamp() {
* @param capacity int maximum size for the LRU cache.
* @param cleanupDelayMillis int milliseconds before scheduling a cleanup (reduction to capacity if the cache currently
* exceeds it).
* @param scheduler ScheduledExecutorService for scheduling cleanup tasks.
* @param cleanupPool ForkJoinPool for executing cleanup tasks.
* @param scheduler ScheduledExecutorService for scheduling cleanup tasks. Can be null. If none is supplied,
* a default scheduler is created for you. Calling the .shutdown() method will shutdown
* the schedule only if you passed in null (using default). If you pass one in, it is
* your responsibility to terminate the scheduler.
* @param cleanupPool ForkJoinPool for executing cleanup tasks. Can be null, in which case the common
* ForkJoinPool is used. When shutdown() is called, nothing is down to the ForkJoinPool.
*/
public ThreadedLRUCacheStrategy(int capacity, int cleanupDelayMillis, ScheduledExecutorService scheduler, ForkJoinPool cleanupPool) {
this.isDefaultScheduler = scheduler == null;
Expand Down

0 comments on commit 8973e68

Please sign in to comment.