[cdi-dev] [JBoss JIRA] (CDI-82) Clarify the usage of EJB3 interceptors as managed beans

Pete Muir (JIRA) jira-events at lists.jboss.org
Tue Sep 11 11:30:32 EDT 2012


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

Pete Muir commented on CDI-82:
------------------------------

Say we have

{code}
public class MyInterceptor {

   @PostConstruct
   public void postConstruct(InvocationContext ctx) {

   }

}
{code}

Then surely this class only defines a @PostConstruct *if* it is used as an interceptor class (and, of course, the inverse). The only issue comes that it would be nice if the container was able to validate that the @PostConstruct was correctly formed, but I don't think it can.

This is how it's specified today:

{quote}
Lifecycle callback interceptor methods defined on an interceptor class have the following signature: void <METHOD>(InvocationContext)
Lifecycle callback interceptor methods defined on a target class have the following signature:
void <METHOD>()
{quote}

I don't think we can improve on this definition.

Interceptors just defines the programming model. CDI defines that a class can either be a bean or an interceptor, however does not define the programming model.

What we have today does not require the container to fail, so should work. Requiring the container not to fail is somewhat of an unusal thing anyway.
                
> Clarify the usage of EJB3 interceptors as managed beans
> -------------------------------------------------------
>
>                 Key: CDI-82
>                 URL: https://issues.jboss.org/browse/CDI-82
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>          Components: Beans, Interceptors, Java EE integration
>    Affects Versions: 1.0
>            Reporter: Marius Bogoevici
>            Assignee: Marius Bogoevici
>             Fix For: 1.1 (Proposed)
>
>
> Background:
> http://lists.jboss.org/pipermail/weld-dev/2010-April/002484.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list