net.sf.sasl.common.helper
Class SpringProxyHelper

java.lang.Object
  extended by net.sf.sasl.common.helper.SpringProxyHelper

public class SpringProxyHelper
extends Object

Class offers some help operations for working with spring proxies.

Since:
0.0.1 (sasl-common-aspect-library)
Author:
Philipp Förmer

Constructor Summary
SpringProxyHelper()
           
 
Method Summary
 Method findNotProxiedMethodDeclaration(Object proxyCandidate, Method method)
          Tries to return the method declaration of the given method signature from the unproxied proxyCandidate.
 Object tryUnproxy(Object candidate)
          Tries to return the original bean object, without any proxy in front of it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringProxyHelper

public SpringProxyHelper()
Method Detail

tryUnproxy

public Object tryUnproxy(Object candidate)
Tries to return the original bean object, without any proxy in front of it. If there are N proxies in front of the bean object: proxyN, proxyN-1, ..., proxy1, beanObject, than the method will try to return the beanObject or null if this fails.
Will only work for AOP proxies created by the spring framework.
Could be useful if informations must be fetched directly from the bean object, for example the class name.

Parameters:
candidate - null or non null possibly proxied object.
Returns:
null or non null
Since:
0.0.1 (sasl-common-library)

findNotProxiedMethodDeclaration

public Method findNotProxiedMethodDeclaration(Object proxyCandidate,
                                              Method method)
Tries to return the method declaration of the given method signature from the unproxied proxyCandidate. Returns null if the resolution fails. Method can be useful to retrieve annotations from the true declaration of the method. Annotations of a proxied object are possibly not present at the proxy methods of the proxy.

Parameters:
proxyCandidate - non null, must not be a proxy.
method - non null.
Returns:
null or non null.
Since:
0.0.2 (sasl-common-library)


Copyright © 2010. All Rights Reserved.