The demo code I used for my going real-time talk.
There are two demos:
Simple AJAX subscription Management. Use the runnable class: AjaxDemo
WebSockets demo that uses JMS for subscription management and Esper (CEP) for subscription queries. Use runnable class: WebsocketDemo