[JBoss JIRA] (CDI-82) Clarify the usage of EJB3 interceptors as managed beans
by Pete Muir (JIRA)
[ https://issues.jboss.org/browse/CDI-82?page=com.atlassian.jira.plugin.sys... ]
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
11 years, 8 months
[JBoss JIRA] (CDI-82) Clarify the usage of EJB3 interceptors as managed beans
by Marius Bogoevici (JIRA)
[ https://issues.jboss.org/browse/CDI-82?page=com.atlassian.jira.plugin.sys... ]
Marius Bogoevici commented on CDI-82:
-------------------------------------
I think there are two parts to it:
- clarify the situation of method signatures (which only the interceptors spec can deal with)
- identify what is an interceptor and what isn't. As long as the interceptors spec allows for vanilla classes to be interceptors, and they can be managed beans as well in CDI, we have this ambiguity.
One way of dealing with this is for the interceptors spec to allow for multiple lifecycle methods of the same kind, disambiguating between self-interception and external interception by method signature - i.e. (@PostConstruct x() is self, @PostConstruct(InvocationContext y) is external ).
But again, this is not the interceptors spec JIRA :).
> 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
11 years, 8 months