You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Shawn Jiang (JIRA)" <ji...@apache.org> on 2011/05/09 16:00:03 UTC

[jira] [Created] (OPENEJB-1546) currently, the inteceptor build only handle the public methods of the bean instead of all methods.

currently,  the inteceptor build only handle the public methods of the bean instead of all methods.
---------------------------------------------------------------------------------------------------

                 Key: OPENEJB-1546
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1546
             Project: OpenEJB
          Issue Type: Bug
          Components: ejb31
    Affects Versions: (trunk/openejb3)
            Reporter: Shawn Jiang
         Attachments: 0008-getMethods-will-only-handle-the-public-method-of-the.patch

In org.apache.openejb.assembler.classic.InterceptorBindingBuilder.build(BeanContext, EnterpriseBeanInfo), following logic is used to find interceptors of all methods of bean class.

for (Method method : beanContext.getBeanClass().getMethods()) {
-            List<InterceptorData> methodInterceptors = createInterceptorDatas(method, beanInfo.ejbName, this.bindings);
-
-            // The bean itself gets to intercept too and is always last.
-            methodInterceptors.add(beanAsInterceptor);
-
-            beanContext.setMethodInterceptors(method, methodInterceptors);
}

But because Class.getMethods() can only return public methods,  we missed all private/protected methods here.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENEJB-1546) currently, the inteceptor build only handle the public methods of the bean instead of all methods.

Posted by "Shawn Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shawn Jiang updated OPENEJB-1546:
---------------------------------

    Attachment: 0008-getMethods-will-only-handle-the-public-method-of-the.patch

use the new logic to handle interceptors of all methods in the bean class.

> currently,  the inteceptor build only handle the public methods of the bean instead of all methods.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENEJB-1546
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1546
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: ejb31
>    Affects Versions: (trunk/openejb3)
>            Reporter: Shawn Jiang
>         Attachments: 0008-getMethods-will-only-handle-the-public-method-of-the.patch
>
>
> In org.apache.openejb.assembler.classic.InterceptorBindingBuilder.build(BeanContext, EnterpriseBeanInfo), following logic is used to find interceptors of all methods of bean class.
> for (Method method : beanContext.getBeanClass().getMethods()) {
> -            List<InterceptorData> methodInterceptors = createInterceptorDatas(method, beanInfo.ejbName, this.bindings);
> -
> -            // The bean itself gets to intercept too and is always last.
> -            methodInterceptors.add(beanAsInterceptor);
> -
> -            beanContext.setMethodInterceptors(method, methodInterceptors);
> }
> But because Class.getMethods() can only return public methods,  we missed all private/protected methods here.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (OPENEJB-1546) currently, the inteceptor build only handle the public methods of the bean instead of all methods.

Posted by "Ivan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan resolved OPENEJB-1546.
---------------------------

       Resolution: Fixed
    Fix Version/s: 4.0

Commit changes to trunk at rev.r1101448. Thanks, Shawn.

> currently,  the inteceptor build only handle the public methods of the bean instead of all methods.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OPENEJB-1546
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1546
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: ejb31
>    Affects Versions: (trunk/openejb3)
>            Reporter: Shawn Jiang
>             Fix For: 4.0
>
>         Attachments: 0008-getMethods-will-only-handle-the-public-method-of-the.patch
>
>
> In org.apache.openejb.assembler.classic.InterceptorBindingBuilder.build(BeanContext, EnterpriseBeanInfo), following logic is used to find interceptors of all methods of bean class.
> for (Method method : beanContext.getBeanClass().getMethods()) {
> -            List<InterceptorData> methodInterceptors = createInterceptorDatas(method, beanInfo.ejbName, this.bindings);
> -
> -            // The bean itself gets to intercept too and is always last.
> -            methodInterceptors.add(beanAsInterceptor);
> -
> -            beanContext.setMethodInterceptors(method, methodInterceptors);
> }
> But because Class.getMethods() can only return public methods,  we missed all private/protected methods here.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira