Is there any way to notify jsf/spring bean when aynchronous messages are received by a java program? Moreover, the java program is a Java BayeuxClient (Cometd) as a pojo. The program successfully receives messages on the meta channels and subscribed channels as shown below.
@Listener(Channel.META_CONNECT)
public void metaConnect(Message message) {
boolean connected = message.isSuccessful();
...
}
@Subscription("/notification")
public void subscribeUpdates(Message message) {
String updates=message.getDataAsMap().toString()
.....
}
FacesContext is not available within these methods, even bean is annotated with(@Component @Scope("session") for jsf/spring integration. Beans cannot be injected as facesContext is not available. How can we inject jsf beans or notify spring bean from the above methods?