Access pushcontext from an EJB layer

Im using Primefaces Push (new in 3.4) along with jsf2 and ejb3. Separate .war and ejb.jar

Now I need to trigger a simple click event from the ejb level. What is a clean way to do this? Some options I can think of:

  • ManagedBean passes callback interface when calling ejb method
  • JMS messagelistener in web tier and ejb for sending messages.
  • Managed bean to parse returned data from an ejb method call and click if conditions are met.

The main question is where to put the code below?

PushContext pushContext = PushContextFactory.getDefault().getPushContext(); pushContext.push("/notifications", new FacesMessage(summary, detail)); 
+1
jsf-2 primefaces ejb atmosphere
Sep 06 '12 at 7:23
source share
1 answer

I have a job, I did not go with any of my ideas above, I just added the dependencies needed to access the atmosphere API from the EJB level.

MANIFEST.MF for ejb.jar:

 Manifest-Version: 1.0 Class-Path: atmosphere-runtime-1.0.1.jar atmosphere-compat-jbossweb-1.0.1.jar atmosphere-compat-tomcat7-1.0.1.jar atmosphere-compat-tomcat-1.0.1.jar 

in pom.xml for ejb.jar and application.ear

  <dependency> <groupId>org.atmosphere</groupId> <artifactId>atmosphere-runtime</artifactId> <version>1.0.1</version> <scope>provided</scope> </dependency> 

Then just copied two packages from source sources in ejb.jar

 org.primefaces.push org.primefaces.json 

because adding feathers to pom.xml in ejb.jar caused

 Missing artifact org.primefaces:primefaces 
0
Oct 21
source share



All Articles