DATAREDIS-538 - Allow @TimeToLive methods that are not accessible by default.
We allow now the use of non-public classes with a @TimeToLive method and @TimeToLive on non-public methods. Original Pull Request: #231
This commit is contained in:
committed by
Christoph Strobl
parent
54229d2388
commit
e62ecbb1a9
@@ -53,6 +53,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
* @since 1.7
|
||||
*/
|
||||
public class RedisMappingContext extends KeyValueMappingContext<RedisPersistentEntity<?>, RedisPersistentProperty> {
|
||||
@@ -256,6 +257,10 @@ public class RedisMappingContext extends KeyValueMappingContext<RedisPersistentE
|
||||
Method timeoutMethod = resolveTimeMethod(type);
|
||||
if (timeoutMethod != null) {
|
||||
|
||||
if (!timeoutMethod.isAccessible()) {
|
||||
ReflectionUtils.makeAccessible(timeoutMethod);
|
||||
}
|
||||
|
||||
TimeToLive ttl = AnnotationUtils.findAnnotation(timeoutMethod, TimeToLive.class);
|
||||
try {
|
||||
Number timeout = (Number) timeoutMethod.invoke(source);
|
||||
|
||||
Reference in New Issue
Block a user