org.equilibriums.aop.utils.interceptor.composite
Class CompositeDelegateInterceptor

java.lang.Object
  extended by org.equilibriums.aop.utils.interceptor.composite.CompositeDelegateInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class CompositeDelegateInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor

Will delegate method calls this interceptor is configured for to specified list of delegates.

Return value from delegate calls are handled by first ReturnValueHandler that will return true from its ReturnValueHandler.supports(java.lang.Class, java.lang.Object[]) method. If no ReturnValueHandler are specified will return null or result of invocation.proceed() if proceed property is true (false by default).

For more on how to use this interceptor see Overview section of this Javadoc.

Author:
Tsolak Petrosian

Constructor Summary
CompositeDelegateInterceptor()
           
 
Method Summary
 ReturnValueHandler[] getDelegateReturnValueHandlers()
           
 Object[] getDelegates()
           
 Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
           
 boolean isProceed()
           
 void setDelegateReturnValueHandlers(ReturnValueHandler[] delegateReturnValueHandlers)
           
 void setDelegates(Object[] delegates)
           
 void setProceed(boolean proceed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeDelegateInterceptor

public CompositeDelegateInterceptor()
Method Detail

isProceed

public boolean isProceed()

setProceed

public void setProceed(boolean proceed)

getDelegates

public Object[] getDelegates()

setDelegates

public void setDelegates(Object[] delegates)

getDelegateReturnValueHandlers

public ReturnValueHandler[] getDelegateReturnValueHandlers()

setDelegateReturnValueHandlers

public void setDelegateReturnValueHandlers(ReturnValueHandler[] delegateReturnValueHandlers)

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable


Copyright © 2011. All Rights Reserved.