[JBoss JIRA] (CDI-696) Decorator for MDB is not used
by Martin Kouba (JIRA)
[ https://issues.jboss.org/browse/CDI-696?page=com.atlassian.jira.plugin.sy... ]
Martin Kouba commented on CDI-696:
----------------------------------
See also "1.2.2. Relationship to EJB":
bq. Message-driven and entity beans are by nature non-contextual objects and may not be injected into other objects.
And "3.6. Java EE components":
bq. Most Java EE components support injection and interception, as defined in the Java Platform, Enterprise Edition Specification 7, table EE.5-1, but are not considered beans (as defined by this specification). EJBs, as defined in Session beans are an exception.
> Decorator for MDB is not used
> -----------------------------
>
> Key: CDI-696
> URL: https://issues.jboss.org/browse/CDI-696
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Decorators, Java EE integration
> Reporter: Alexandr Sokolov
>
> Guys, I'm using Wildfly 8.2.1.Final
> Here is MDB bean:
> {code:java}
> @MessageDriven(activationConfig = {
> @ActivationConfigProperty(propertyName = "destinationLookup",
> propertyValue = "topic/dse"),
> @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Topic")
> })
> public class JobChangedSubscriber implements MessageListener {
> ...
> @Override
> public void onMessage(final Message message) {
> ...
> }
> }
> {code}
> And decorator:
> {code:java}
> @Decorator
> public class RetroplannerSubscriber implements MessageListener {
> @Inject
> @Delegate
> @Any
> JobChangedSubscriber jobChangedSubscriber;
> @Override
> public void onMessage(Message message) {
> jobChangedSubscriber.onMessage(message);
> //custom code
> }
> }
> {code}
> During deployment, all mistakes about decorator definition are shown. They were fixed. I was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
> As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 9 months
[JBoss JIRA] (CDI-696) Decorator for MDB is not used
by Alexandr Sokolov (JIRA)
[ https://issues.jboss.org/browse/CDI-696?page=com.atlassian.jira.plugin.sy... ]
Alexandr Sokolov commented on CDI-696:
--------------------------------------
Ok. I think I'm as a client expect more than I should and my understanding of managed beans can be wrong.
> Decorator for MDB is not used
> -----------------------------
>
> Key: CDI-696
> URL: https://issues.jboss.org/browse/CDI-696
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Decorators, Java EE integration
> Reporter: Alexandr Sokolov
>
> Guys, I'm using Wildfly 8.2.1.Final
> Here is MDB bean:
> {code:java}
> @MessageDriven(activationConfig = {
> @ActivationConfigProperty(propertyName = "destinationLookup",
> propertyValue = "topic/dse"),
> @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Topic")
> })
> public class JobChangedSubscriber implements MessageListener {
> ...
> @Override
> public void onMessage(final Message message) {
> ...
> }
> }
> {code}
> And decorator:
> {code:java}
> @Decorator
> public class RetroplannerSubscriber implements MessageListener {
> @Inject
> @Delegate
> @Any
> JobChangedSubscriber jobChangedSubscriber;
> @Override
> public void onMessage(Message message) {
> jobChangedSubscriber.onMessage(message);
> //custom code
> }
> }
> {code}
> During deployment, all mistakes about decorator definition are shown. They were fixed. I was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
> As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 9 months
[JBoss JIRA] (CDI-696) Decorator for MDB is not used
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-696?page=com.atlassian.jira.plugin.sy... ]
John Ament commented on CDI-696:
--------------------------------
[~avsokolov] that's incorrect. We expose an SPI that does that, for instance how DeltaSpike uses {{InjectionTarget.inject}} - https://github.com/apache/deltaspike/blob/master/deltaspike/core/api/src/...
> Decorator for MDB is not used
> -----------------------------
>
> Key: CDI-696
> URL: https://issues.jboss.org/browse/CDI-696
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Decorators, Java EE integration
> Reporter: Alexandr Sokolov
>
> Guys, I'm using Wildfly 8.2.1.Final
> Here is MDB bean:
> {code:java}
> @MessageDriven(activationConfig = {
> @ActivationConfigProperty(propertyName = "destinationLookup",
> propertyValue = "topic/dse"),
> @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Topic")
> })
> public class JobChangedSubscriber implements MessageListener {
> ...
> @Override
> public void onMessage(final Message message) {
> ...
> }
> }
> {code}
> And decorator:
> {code:java}
> @Decorator
> public class RetroplannerSubscriber implements MessageListener {
> @Inject
> @Delegate
> @Any
> JobChangedSubscriber jobChangedSubscriber;
> @Override
> public void onMessage(Message message) {
> jobChangedSubscriber.onMessage(message);
> //custom code
> }
> }
> {code}
> During deployment, all mistakes about decorator definition are shown. They were fixed. I was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
> As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 9 months
[JBoss JIRA] (CDI-696) Decorator for MDB is not used
by Alexandr Sokolov (JIRA)
[ https://issues.jboss.org/browse/CDI-696?page=com.atlassian.jira.plugin.sy... ]
Alexandr Sokolov commented on CDI-696:
--------------------------------------
John, if MDB would no be actually managed bean, I would not be able to inject beans in to it. And I'd have to think about life cycle of this bean. It seems that some functionality works with MDB, like with usual managed beans. But exact decorators - no.
> Decorator for MDB is not used
> -----------------------------
>
> Key: CDI-696
> URL: https://issues.jboss.org/browse/CDI-696
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Decorators, Java EE integration
> Reporter: Alexandr Sokolov
>
> Guys, I'm using Wildfly 8.2.1.Final
> Here is MDB bean:
> {code:java}
> @MessageDriven(activationConfig = {
> @ActivationConfigProperty(propertyName = "destinationLookup",
> propertyValue = "topic/dse"),
> @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Topic")
> })
> public class JobChangedSubscriber implements MessageListener {
> ...
> @Override
> public void onMessage(final Message message) {
> ...
> }
> }
> {code}
> And decorator:
> {code:java}
> @Decorator
> public class RetroplannerSubscriber implements MessageListener {
> @Inject
> @Delegate
> @Any
> JobChangedSubscriber jobChangedSubscriber;
> @Override
> public void onMessage(Message message) {
> jobChangedSubscriber.onMessage(message);
> //custom code
> }
> }
> {code}
> During deployment, all mistakes about decorator definition are shown. They were fixed. I was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
> As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 9 months
[JBoss JIRA] (CDI-696) Decorator for MDB is not used
by John Ament (JIRA)
[ https://issues.jboss.org/browse/CDI-696?page=com.atlassian.jira.plugin.sy... ]
John Ament commented on CDI-696:
--------------------------------
Most specs are pretty ambiguous in this area, however the root of the problem is that most of these EE objects are not actually managed beans. If you look at message listeners, servlets, filters, they all support injection, but themselves are not managed by CDI as a runtime. The containers will delegate down to CDI to provide injection support into those classes.
> Decorator for MDB is not used
> -----------------------------
>
> Key: CDI-696
> URL: https://issues.jboss.org/browse/CDI-696
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Decorators, Java EE integration
> Reporter: Alexandr Sokolov
>
> Guys, I'm using Wildfly 8.2.1.Final
> Here is MDB bean:
> {code:java}
> @MessageDriven(activationConfig = {
> @ActivationConfigProperty(propertyName = "destinationLookup",
> propertyValue = "topic/dse"),
> @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Topic")
> })
> public class JobChangedSubscriber implements MessageListener {
> ...
> @Override
> public void onMessage(final Message message) {
> ...
> }
> }
> {code}
> And decorator:
> {code:java}
> @Decorator
> public class RetroplannerSubscriber implements MessageListener {
> @Inject
> @Delegate
> @Any
> JobChangedSubscriber jobChangedSubscriber;
> @Override
> public void onMessage(Message message) {
> jobChangedSubscriber.onMessage(message);
> //custom code
> }
> }
> {code}
> During deployment, all mistakes about decorator definition are shown. They were fixed. I was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
> As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 9 months
[JBoss JIRA] (CDI-696) Decorator for MDB is not used
by Tomas Remes (JIRA)
[ https://issues.jboss.org/browse/CDI-696?page=com.atlassian.jira.plugin.sy... ]
Tomas Remes commented on CDI-696:
---------------------------------
OK so it doesn't seem to work. So the question is whether it should. I cannot find such evidence in specifications. EJB 3.2 spec defines only support for interceptors in {{5.4.10 Message Listener Interceptor Methods for Message-Driven Beans}} AFAIK.
> Decorator for MDB is not used
> -----------------------------
>
> Key: CDI-696
> URL: https://issues.jboss.org/browse/CDI-696
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Decorators, Java EE integration
> Reporter: Alexandr Sokolov
>
> Guys, I'm using Wildfly 8.2.1.Final
> Here is MDB bean:
> {code:java}
> @MessageDriven(activationConfig = {
> @ActivationConfigProperty(propertyName = "destinationLookup",
> propertyValue = "topic/dse"),
> @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Topic")
> })
> public class JobChangedSubscriber implements MessageListener {
> ...
> @Override
> public void onMessage(final Message message) {
> ...
> }
> }
> {code}
> And decorator:
> {code:java}
> @Decorator
> public class RetroplannerSubscriber implements MessageListener {
> @Inject
> @Delegate
> @Any
> JobChangedSubscriber jobChangedSubscriber;
> @Override
> public void onMessage(Message message) {
> jobChangedSubscriber.onMessage(message);
> //custom code
> }
> }
> {code}
> During deployment, all mistakes about decorator definition are shown. They were fixed. I was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
> As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 9 months
[JBoss JIRA] (CDI-696) Decorator for MDB is not used
by Tomas Remes (JIRA)
[ https://issues.jboss.org/browse/CDI-696?page=com.atlassian.jira.plugin.sy... ]
Tomas Remes commented on CDI-696:
---------------------------------
Hi [~avsokolov],
I don't think your question is adequate as a CDI issue. This sounds more like question on forum. Anyway do you define your {{RetroplannerSubscriber}} in beans.xml as a decorator? I am going to verify this behaviour with WildFly 10.1.0.Final. Not really sure but I think it could work since interception works.
> Decorator for MDB is not used
> -----------------------------
>
> Key: CDI-696
> URL: https://issues.jboss.org/browse/CDI-696
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Decorators, Java EE integration
> Reporter: Alexandr Sokolov
>
> Guys, I'm using Wildfly 8.2.1.Final
> Here is MDB bean:
> {code:java}
> @MessageDriven(activationConfig = {
> @ActivationConfigProperty(propertyName = "destinationLookup",
> propertyValue = "topic/dse"),
> @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Topic")
> })
> public class JobChangedSubscriber implements MessageListener {
> ...
> @Override
> public void onMessage(final Message message) {
> ...
> }
> }
> {code}
> And decorator:
> {code:java}
> @Decorator
> public class RetroplannerSubscriber implements MessageListener {
> @Inject
> @Delegate
> @Any
> JobChangedSubscriber jobChangedSubscriber;
> @Override
> public void onMessage(Message message) {
> jobChangedSubscriber.onMessage(message);
> //custom code
> }
> }
> {code}
> During deployment, all mistakes about decorator definition are shown. They were fixed. I was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
> As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 9 months
[JBoss JIRA] (CDI-696) Decorator for MDB is not used
by Alexandr Sokolov (JIRA)
Alexandr Sokolov created CDI-696:
------------------------------------
Summary: Decorator for MDB is not used
Key: CDI-696
URL: https://issues.jboss.org/browse/CDI-696
Project: CDI Specification Issues
Issue Type: Bug
Components: Decorators, Java EE integration
Reporter: Alexandr Sokolov
Guys, I'm using Wildfly 8.2.1.Final
Here is MDB bean:
{code:java}
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationLookup",
propertyValue = "topic/dse"),
@ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Topic")
})
public class JobChangedSubscriber implements MessageListener {
...
@Override
public void onMessage(final Message message) {
...
}
}
{code}
And decorator:
{code:java}
@Decorator
public class RetroplannerSubscriber implements MessageListener {
@Inject
@Delegate
@Any
JobChangedSubscriber jobChangedSubscriber;
@Override
public void onMessage(Message message) {
jobChangedSubscriber.onMessage(message);
//custom code
}
}
{code}
During deployment, all mistakes about decorator definition are shown. They were fixed. I was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 9 months