One socket to listener the channel and call the javascript function.
<p:socket onMessage="functionName" channel="/notifyTreeMap" />
The tag remmote command can be used to
<h:form>
<p:remoteCommand id="test" name="functionName" actionListener="" update="" global="false" />
</h:form>
In Menaged Bean, get context by;
PushContext pushContext = PushContextFactory.getDefault().getPushContext();
To use primepush in jboss the atmosphere dependence is needed.
<dependency>
<groupId>org.atmosphere.jboss.as</groupId>
<artifactId>jboss-as-websockets</artifactId>
<version>0.5</version>
</dependency>