public void getTemperature(final Location location) {
new Timer().scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
final Response response = new Response();
response.setDate(new Date());
final String data = "" + Helper.randomInt(40);
response.setData(data);
WebsocketStatus status = callback.sendMessage(response);
if (status == WebsocketStatus.CLOSED) {
System.out.println("Client disconnected from TemperatureService.");
this.cancel();
}