[Primefaces Push] Injecter un bean managé dans une ressource PushEndpoint
Bonjour,
Je voudrais savoir si c'est possible d'injecter un bean managé :
Code:
1 2 3
| @Named [javax.inject.Named]
@ApplicationScoped [javax.enterprise.context.ApplicationScoped]
public AppManager implements Serializable {[...]} |
Dans une ressource PushEndpoint :
Code:
1 2 3 4 5
| @PushEndpoint("/myPath") [org.primefaces.push.annotation.PushEndpoint]
@Singleton [org.primefaces.push.annotation.Singleton]
public class PushRessource {
<div style="margin-left:40px"> //Avec</div><div style="margin-left:40px"> @Inject</div><div style="margin-left:40px"> private AppManager appManager;</div>
<div style="margin-left:40px"> @OnClose</div><div style="margin-left:40px"> public void onClose(RemoteEndpoint r, EventBus eventBus) {</div><div style="margin-left:40px"><div style="margin-left:40px"> //appManager est toujours null</div></div><div style="margin-left:40px"><div style="margin-left:40px"> appManager.test();</div></div><div style="margin-left:40px"> }</div>} |
Car je n'arrive pas à le faire fonctionner
pom.xml :
Code:
1 2
| <dependencies>
<div style="margin-left:40px"> <dependency></div><div style="margin-left:40px"><div style="margin-left:40px"> <groupId>org.atmosphere</groupId></div></div><div style="margin-left:40px"><div style="margin-left:40px"> <artifactId>atmosphere-runtime</artifactId></div></div><div style="margin-left:40px"><div style="margin-left:40px"> <version>2.3.0-RC6</version></div></div><div style="margin-left:40px"> </dependency></div><div style="margin-left:40px"> <dependency></div><div style="margin-left:40px"><div style="margin-left:40px"> <groupId>org.primefaces</groupId></div></div><div style="margin-left:40px"><div style="margin-left:40px"> <artifactId>primefaces</artifactId></div></div><div style="margin-left:40px"><div style="margin-left:40px"> <version>5.2</version></div></div><div style="margin-left:40px"> </dependency></div><div style="margin-left:40px"> <dependency></div><div style="margin-left:40px"><div style="margin-left:40px"> <groupId>javax</groupId></div></div><div style="margin-left:40px"><div style="margin-left:40px"> <artifactId>javaee-web-api</artifactId></div></div><div style="margin-left:40px"><div style="margin-left:40px"> <version>7.0</version></div></div><div style="margin-left:40px"><div style="margin-left:40px"> <scope>provided</scope></div></div><div style="margin-left:40px"> </dependency></div></dependencies> |
Merci d'avance