Long Polling in JAX-RS (Rest api)

I am trying to make methods call using long polling in JAX RS rest api. I have brief idea about long polling and how it works. However, I am a newbie so I could use come concrete idea/example on how to make rest method calls using long polling?