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