Just trying to iron out the last few errors from my binding.
My Bridge handler takes care of all polling (external api) and updates the Thing handler channels by using httpUtil in a separate class Http and calling:
Http http = new Http();
String response = http.httpClient("features", data, "application/json", "");
public String httpClient(@Nullable String type, @Nullable InputStream data, @Nullable String other,
@Nullable String groupId) {
String response = "";
try {
response = HttpUtil.executeUrl(method(type), url(type, groupId), getHeader(type), data, other, 100000);
} catch (IOException e) {
logger.warn("Http Util threw an error, its possible you just restarted the binding");
}
return response;
}
This all runs in a separate thread:
Runnable runnable = new Runnable() {
@Override
public void run() {
polling();
}
};
refreshTask = scheduler.scheduleWithFixedDelay(runnable,10, pollingInterval, TimeUnit.MILLISECONDS);
}
If I remove the binding on the disposal of the Bridge handler httpUtil throws an IOException (custom error message)even though I cancel the refresh task as the first part of the dispose:
2020-03-10 09:35:52.562 [DEBUG] [rf.internal.handler.LWAccountHandler] - Running dispose()
2020-03-10 09:35:52.564 [WARN ] [ab.binding.lightwaverf.internal.Http] - Http Util threw an error, its possible you just restarted the binding
2020-03-10 09:35:52.564 [DEBUG] [rf.internal.handler.LWAccountHandler] - JSON Is Normal, Response is:
How do i stop this from happening?