net.sf.tie.ext.interceptor
Class SynchronizedInterceptor
java.lang.Object
net.sf.tie.ext.interceptor.SynchronizedInterceptor
- All Implemented Interfaces:
- Advice, Interceptor, MethodInterceptor
public class SynchronizedInterceptor
- extends Object
- implements MethodInterceptor
The SynchronizedInterceptor
applies a synchronization block (using a provided "lock" object) around each method invocation.
It the provided lock is null
, then the end-point of the invocation is used instead.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SynchronizedInterceptor
public SynchronizedInterceptor(Object lock)
- Parameters:
lock
- The object to synchronize around. May be null
in which case the result of Joinpoint.getThis()
is used for each call.
invoke
public Object invoke(MethodInvocation invocation)
throws Throwable
- Specified by:
invoke
in interface MethodInterceptor
- Throws:
Throwable