|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.equilibriums.aop.utils.interceptor.delegate.DelegateInterceptor
public class DelegateInterceptor
Will delegate method calls this interceptor is configured for to specified delegates.
You can optionally override delegate's method to be called by specifying delegateMethodMap.
Return value from delegate calls are handled by first DelegateReturnValueHandler that will return true from its
DelegateReturnValueHandler.supports(java.lang.Class extends java.lang.Object>, java.util.List method.
If no DelegateReturnValueHandler are specified will return null.
Here are some Design Pattern use cases that can be achieved by this interceptor without declaring any new type.
For more on how to use this interceptor see Overview section of this Javadoc.
| Constructor Summary | |
|---|---|
DelegateInterceptor()
|
|
| Method Summary | |
|---|---|
Map<Object,Method> |
getDelegateMethodMap()
Map where key is delegate and value is the method to be called by this interceptor instead of using invocation.getMethod() method. |
List<DelegateReturnValueHandler> |
getDelegateReturnValueHandlers()
|
List<Object> |
getDelegates()
|
Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation)
|
void |
setDelegateMethodMap(Map<Object,Method> delegateMethodMap)
|
void |
setDelegateReturnValueHandlers(List<DelegateReturnValueHandler> delegateReturnValueHandlers)
|
void |
setDelegates(List<Object> delegates)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DelegateInterceptor()
| Method Detail |
|---|
public List<Object> getDelegates()
public void setDelegates(List<Object> delegates)
public Map<Object,Method> getDelegateMethodMap()
public void setDelegateMethodMap(Map<Object,Method> delegateMethodMap)
public List<DelegateReturnValueHandler> getDelegateReturnValueHandlers()
public void setDelegateReturnValueHandlers(List<DelegateReturnValueHandler> delegateReturnValueHandlers)
public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
throws Throwable
invoke in interface org.aopalliance.intercept.MethodInterceptorThrowable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||