@GET
@Path("/connect")
public SuspendResponse<String> connect(@QueryParam("sessionId") String sessionId) {
Broadcaster broadcaster = CometSessionManager.get(sessionId);
if (broadcaster == null) {
broadcaster = new JerseyBroadcaster(sessionId);
BroadcasterLifeCyclePolicy policy = new BroadcasterLifeCyclePolicy.Builder().policy(
ATMOSPHERE_RESOURCE_POLICY.EMPTY_DESTROY).build();
broadcaster.setBroadcasterLifeCyclePolicy(policy);
broadcaster.addBroadcasterLifeCyclePolicyListener(new CometBroadcasterLifeCyclePolicyListener(sessionId));
CometSessionManager.add(sessionId, broadcaster);