/**
  * Simply starts the stream.
  *
  * @param id the id
  */
 @RequestMapping(value = "/start/{id}", method = RequestMethod.GET)
 @ResponseStatus(value = HttpStatus.OK, reason = "Successfully started stream")
 public final void start(@PathVariable final long id) {
   LOGGER.info("Shutting down stream");
   stream.shutdown();
   stream.addListener(listener);
   List<String> portfolioTokens = portfolioService.getStreamTokens(id);
   stream.filter(
       new FilterQuery(
           0, new long[0], portfolioTokens.toArray(new String[portfolioTokens.size()])));
   LOGGER.info("Successfully started stream: " + portfolioTokens);
 }
 /** Stop. */
 @RequestMapping(value = "/stop", method = RequestMethod.GET)
 @ResponseStatus(value = HttpStatus.OK, reason = "Successfully stopped stream")
 public final void stop() {
   stream.shutdown();
   LOGGER.info("Successfully stopped stream");
 }
예제 #3
0
 @Override
 public void close() {
   _twitterStream.shutdown();
 }
예제 #4
0
 @Override
 public void close() {
   twitterStream.shutdown();
   super.close();
 }
예제 #5
0
 /** Stops the Source's event processing and shuts down the Twitter stream. */
 @Override
 public void stop() {
   logger.debug("Shutting down Twitter sample stream...");
   twitterStream.shutdown();
   super.stop();
 }
 /** What happens when the stream is shutdown */
 @Override
 public void stop() {
   System.out.println("Shutting down");
   twitterStream.shutdown();
   super.stop();
 }