Skip to content

Commit 5f27ff5

Browse files
committed
Do not deprecate getReadWriteLock, just add to the docs that it is not
used.
1 parent e6d8c8c commit 5f27ff5

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/main/java/org/apache/ibatis/cache/Cache.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
import java.util.concurrent.locks.ReadWriteLock;
1919

2020
/**
21-
* Interface to be implemented by cache providers.
21+
* SPI for cache providers.
2222
*
2323
* One instance of cache will be created for each namespace.
2424
*
2525
* The cache implementation must have a constructor that receives the cache id as an String parameter.
2626
*
27+
* MyBatis will pass the namespace as id to the constructor.
28+
*
2729
* <pre>
2830
* public MyCache(final String id) {
2931
* if (id == null) {
@@ -43,13 +45,6 @@ public interface Cache {
4345
*/
4446
String getId();
4547

46-
/**
47-
* Optional. It is not called by the core.
48-
*
49-
* @return The cache size.
50-
*/
51-
int getSize();
52-
5348
/**
5449
* @param key Can be any object but usually it is a {@link CacheKey}
5550
* @param value The result of a select.
@@ -75,12 +70,19 @@ public interface Cache {
7570
*/
7671
void clear();
7772

73+
/**
74+
* Optional. This method is not called by the core.
75+
*
76+
* @return The number of elements stored in the cache (not its capacity).
77+
*/
78+
int getSize();
79+
7880
/**
79-
* As of 3.2.6 this method is no longer called by the core.
81+
* Optional. As of 3.2.6 this method is no longer called by the core.
82+
*
8083
* Any locking needed by the cache must be provided internally by the cache provider.
8184
*
8285
* @return A ReadWriteLock
83-
* @deprecated
8486
*/
8587
ReadWriteLock getReadWriteLock();
8688

0 commit comments

Comments
 (0)