[cdi-dev] [JBoss JIRA] Commented: (CDI-137) Changing ProcessManagedBean getBean Method Signature

Pete Muir (JIRA) jira-events at lists.jboss.org
Thu Jun 23 08:05:23 EDT 2011

    [ https://issues.jboss.org/browse/CDI-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610639#comment-12610639 ] 

Pete Muir commented on CDI-137:

I would suggest introducing a new Process event than changing this one. We need to keep backwards incompatible changes to an absolute minimum. There is nothing wrong with ProcessSessionBean today, it simply doesn't do what *you* want ;-)

> Changing ProcessManagedBean getBean Method Signature
> ----------------------------------------------------
>                 Key: CDI-137
>                 URL: https://issues.jboss.org/browse/CDI-137
>             Project: CDI Specification Issues
>          Issue Type: Bug
>          Components: Portable Extensions
>    Affects Versions: 1.0
>            Reporter: Gurkan Erdogdu
>             Fix For: 1.1 (Confirmed)
> Currently ProcessSessionBean class signature is
> public class ProcessSessionBean<T> extends ProcessManagedBean<Object>{}
> Therefore, observers work as
> Example: 
> @Stateless
> public class Elephant{}
> public void observe(ProcessBean<Elephant>) --> Not allowed
> public void observe(ProcessSessionBean<Elephant>) --> Allowed
> Pete said that main reason of using ProcessManagedBean<Object> is that 
> "ProcessBean<X> offers a method getBean() which returns Bean<X>. Bean<X> has a method of type create() which returns an X. If we were to have ProcessSessionBean<X> extend ProcessManagedBean<X> then this would imply that you can create something of type, which in the case of a session bean is the bean class (which can't be created for EJBs with local or remote business interfaces). So ProcessSessionBean is correct as is."
> Main reason of using the ProcessSessionBean event is to observe "Session Bean Class" registration, not the observe for the session bean local interface/s.
> Moreover, other methods in the interface hierarchy of "ProcessSessionBean" gets <X> into the account, for example
> AnnotatedType<X> getAnnotatedBeanClass()
>           Returns the AnnotatedType representing the bean class.
> Therefore, it is more convenient to change "ProcessManagedBean getBean"  method  decleration as
> public <T> Bean<T> getBean(); where T is the local/local view interface of the session bean.
> And change the ProcessSessionBean signature as
> public class ProcessSessionBean<X> extends ProcessManagedBean<X>{}
> Also See https://issues.jboss.org/browse/CDITCK-215

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


More information about the cdi-dev mailing list