@ GET @ Path ( "/{ccid: [A-Z,a-z,0-9,_,\\-,\\.]+}" ) @ Produces ( { MediaType . APPLICATION_JSON } ) @ Suspend ( resumeOnBroadcast = true , period = ChannelServiceConstants . EXPIRE_TIME_CONNECTION , timeUnit = TimeUnit . SECONDS , contentType = MediaType . APPLICATION_JSON ) public Broadcastable open ( @ PathParam ( "ccid" ) String ccid , @ HeaderParam ( "X-Cache-Index" ) Integer cacheIndex , @ HeaderParam ( ChannelServiceConstants . X_ATMOSPHERE_TRACKING_ID ) String atmosphereTrackingId ) { try { return channelService . openChannel ( ccid , cacheIndex , atmosphereTrackingId ) ; } catch ( WebApplicationException e ) { throw e ; } catch ( Exception e ) { log . error ( "GET Channels open long poll ccid: error: {}" , e . getMessage ( ) , e ) ; throw new WebApplicationException ( Status . INTERNAL_SERVER_ERROR ) ; } }
Open a long poll channel for the given cluster controller . The channel is closed automatically by the server at regular intervals to ensure liveliness .