Java Code Examples for org.springframework.cache.interceptor.CacheOperationInvocationContext#getArgs()

The following examples show how to use org.springframework.cache.interceptor.CacheOperationInvocationContext#getArgs() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CacheReproTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
@Nullable
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context) {
	String cacheName = (String) context.getArgs()[0];
	if (cacheName != null) {
		return Collections.singleton(cacheName);
	}
	return null;
}
 
Example 2
Source File: CacheReproTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
@Nullable
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context) {
	String cacheName = (String) context.getArgs()[0];
	if (cacheName != null) {
		return Collections.singleton(cacheName);
	}
	return null;
}
 
Example 3
Source File: CacheReproTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context) {
	String cacheName = (String) context.getArgs()[0];
	if (cacheName != null) {
		return Collections.singleton(cacheName);
	}
	return null;
}
 
Example 4
Source File: AbstractKeyCacheInterceptor.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Create a {@link CacheKeyInvocationContext} based on the specified invocation.
 * @param context the context of the invocation.
 * @return the related {@code CacheKeyInvocationContext}
 */
protected CacheKeyInvocationContext<A> createCacheKeyInvocationContext(CacheOperationInvocationContext<O> context) {
	return new DefaultCacheKeyInvocationContext<>(context.getOperation(), context.getTarget(), context.getArgs());
}
 
Example 5
Source File: AbstractKeyCacheInterceptor.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Create a {@link CacheKeyInvocationContext} based on the specified invocation.
 * @param context the context of the invocation.
 * @return the related {@code CacheKeyInvocationContext}
 */
protected CacheKeyInvocationContext<A> createCacheKeyInvocationContext(CacheOperationInvocationContext<O> context) {
	return new DefaultCacheKeyInvocationContext<>(context.getOperation(), context.getTarget(), context.getArgs());
}
 
Example 6
Source File: AbstractKeyCacheInterceptor.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a {@link CacheKeyInvocationContext} based on the specified invocation.
 * @param context the context of the invocation.
 * @return the related {@code CacheKeyInvocationContext}
 */
protected CacheKeyInvocationContext<A> createCacheKeyInvocationContext(
		CacheOperationInvocationContext<O> context) {
	return new DefaultCacheKeyInvocationContext<A>(context.getOperation(), context.getTarget(), context.getArgs());
}
 
Example 7
Source File: AbstractKeyCacheInterceptor.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Create a {@link CacheKeyInvocationContext} based on the specified invocation.
 * @param context the context of the invocation.
 * @return the related {@code CacheKeyInvocationContext}
 */
protected CacheKeyInvocationContext<A> createCacheKeyInvocationContext(
		CacheOperationInvocationContext<O> context) {
	return new DefaultCacheKeyInvocationContext<A>(context.getOperation(), context.getTarget(), context.getArgs());
}