Java Code Examples for org.springframework.aop.framework.AopProxyUtils#proxiedUserInterfaces()

The following examples show how to use org.springframework.aop.framework.AopProxyUtils#proxiedUserInterfaces() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ObjectUtil.java    From sofa-acts with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * 
 * @param methodName
 * @param testedObj
 * @return
 */
public static Method findMethod(String methodName, Object testedObj) {

    Class<?>[] clazzes = AopProxyUtils.proxiedUserInterfaces(testedObj);

    for (Class<?> clazz : clazzes) {
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            if (StringUtils.equals(method.getName(), methodName)) {
                return method;
            }
        }
    }
    return null;
}
 
Example 2
Source File: AbstractReflectiveMBeanInfoAssembler.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * Return the class to be used for the JMX descriptor field "class".
 * Only applied when the "exposeClassDescriptor" property is "true".
 * <p>The default implementation returns the first implemented interface
 * for a JDK proxy, and the target class else.
 * @param managedBean the bean instance (might be an AOP proxy)
 * @return the class to expose in the descriptor field "class"
 * @see #setExposeClassDescriptor
 * @see #getClassToExpose(Class)
 * @see org.springframework.aop.framework.AopProxyUtils#proxiedUserInterfaces(Object)
 */
protected Class<?> getClassForDescriptor(Object managedBean) {
	if (AopUtils.isJdkDynamicProxy(managedBean)) {
		return AopProxyUtils.proxiedUserInterfaces(managedBean)[0];
	}
	return getClassToExpose(managedBean);
}
 
Example 3
Source File: AbstractReflectiveMBeanInfoAssembler.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * Return the class to be used for the JMX descriptor field "class".
 * Only applied when the "exposeClassDescriptor" property is "true".
 * <p>The default implementation returns the first implemented interface
 * for a JDK proxy, and the target class else.
 * @param managedBean the bean instance (might be an AOP proxy)
 * @return the class to expose in the descriptor field "class"
 * @see #setExposeClassDescriptor
 * @see #getClassToExpose(Class)
 * @see org.springframework.aop.framework.AopProxyUtils#proxiedUserInterfaces(Object)
 */
protected Class<?> getClassForDescriptor(Object managedBean) {
	if (AopUtils.isJdkDynamicProxy(managedBean)) {
		return AopProxyUtils.proxiedUserInterfaces(managedBean)[0];
	}
	return getClassToExpose(managedBean);
}
 
Example 4
Source File: AbstractReflectiveMBeanInfoAssembler.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Return the class to be used for the JMX descriptor field "class".
 * Only applied when the "exposeClassDescriptor" property is "true".
 * <p>The default implementation returns the first implemented interface
 * for a JDK proxy, and the target class else.
 * @param managedBean the bean instance (might be an AOP proxy)
 * @return the class to expose in the descriptor field "class"
 * @see #setExposeClassDescriptor
 * @see #getClassToExpose(Class)
 * @see org.springframework.aop.framework.AopProxyUtils#proxiedUserInterfaces(Object)
 */
protected Class<?> getClassForDescriptor(Object managedBean) {
	if (AopUtils.isJdkDynamicProxy(managedBean)) {
		return AopProxyUtils.proxiedUserInterfaces(managedBean)[0];
	}
	return getClassToExpose(managedBean);
}
 
Example 5
Source File: AbstractReflectiveMBeanInfoAssembler.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Return the class to be used for the JMX descriptor field "class".
 * Only applied when the "exposeClassDescriptor" property is "true".
 * <p>The default implementation returns the first implemented interface
 * for a JDK proxy, and the target class else.
 * @param managedBean the bean instance (might be an AOP proxy)
 * @return the class to expose in the descriptor field "class"
 * @see #setExposeClassDescriptor
 * @see #getClassToExpose(Class)
 * @see org.springframework.aop.framework.AopProxyUtils#proxiedUserInterfaces(Object)
 */
protected Class<?> getClassForDescriptor(Object managedBean) {
	if (AopUtils.isJdkDynamicProxy(managedBean)) {
		return AopProxyUtils.proxiedUserInterfaces(managedBean)[0];
	}
	return getClassToExpose(managedBean);
}