类 CachingOperationInvoker
- java.lang.Object
- org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvoker
- 所有已实现的接口:
OperationInvoker
public class CachingOperationInvoker extends Object implements OperationInvoker
AnOperationInvoker
that caches the response of an operation with a configurable time to live.- 从以下版本开始:
- 2.0.0
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static OperationInvoker
apply(OperationInvoker invoker, long timeToLive)
Apply caching configuration when appropriate to the given invoker.long
getTimeToLive()
Return the maximum time in milliseconds that a response can be cached.Object
invoke(InvocationContext context)
Invoke the underlying operation using the givencontext
.
方法详细资料
getTimeToLive
public long getTimeToLive()
Return the maximum time in milliseconds that a response can be cached.- 返回:
- the time to live of a response
invoke
public Object invoke(InvocationContext context)
从接口复制的说明:OperationInvoker
Invoke the underlying operation using the givencontext
.- 指定者:
invoke
在接口中OperationInvoker
- 参数:
context
- the context to use to invoke the operation- 返回:
- the result of the operation, may be
null
apply
public static OperationInvoker apply(OperationInvoker invoker, long timeToLive)
Apply caching configuration when appropriate to the given invoker.- 参数:
invoker
- the invoker to wraptimeToLive
- the maximum time in milliseconds that a response can be cached- 返回:
- a caching version of the invoker or the original instance if caching is not required