Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

CacheResultAdvice.Invoke Method

Applies caching around a method invocation.

[Visual Basic]
Public NotOverridable Sub Invoke( _
   ByVal invocation As IMethodInvocation _
) _
    Implements IMethodInterceptor.Invoke
[C#]
public object Invoke(
   IMethodInvocation invocation
);

Parameters

invocation
The method invocation that is being intercepted.

Return Value

A cached object or the result of the Proceed call.

Implements

IMethodInterceptor.Invoke

Remarks

This method tries to retrieve an object from the cache, using the supplied invocation to generate a cache key. If an object is found in the cache, the cached value is returned and the method call does not proceed any further down the invocation chain.

If object does not exist in the cache, the advised method is called (using Proceed) and any return value is cached for the next method invocation.

Exceptions

Exception Type Condition
Exception If any of the interceptors in the chain or the target object itself throws an exception.

See Also

CacheResultAdvice Class | Spring.Aspects.Cache Namespace