[hdpowerview] deferred instantiation of JAX-RS client (#9002)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
parent
5b7f1b0e67
commit
0856a0b3f2
|
@ -21,7 +21,6 @@ import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import javax.ws.rs.ProcessingException;
|
import javax.ws.rs.ProcessingException;
|
||||||
import javax.ws.rs.client.Client;
|
|
||||||
import javax.ws.rs.client.ClientBuilder;
|
import javax.ws.rs.client.ClientBuilder;
|
||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
|
@ -68,7 +67,6 @@ public class HDPowerViewHubHandler extends BaseBridgeHandler {
|
||||||
private long refreshInterval;
|
private long refreshInterval;
|
||||||
private long hardRefreshInterval;
|
private long hardRefreshInterval;
|
||||||
|
|
||||||
private final Client client = ClientBuilder.newClient();
|
|
||||||
private @Nullable HDPowerViewWebTargets webTargets;
|
private @Nullable HDPowerViewWebTargets webTargets;
|
||||||
private @Nullable ScheduledFuture<?> pollFuture;
|
private @Nullable ScheduledFuture<?> pollFuture;
|
||||||
private @Nullable ScheduledFuture<?> hardRefreshFuture;
|
private @Nullable ScheduledFuture<?> hardRefreshFuture;
|
||||||
|
@ -116,7 +114,7 @@ public class HDPowerViewHubHandler extends BaseBridgeHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
webTargets = new HDPowerViewWebTargets(client, host);
|
webTargets = new HDPowerViewWebTargets(ClientBuilder.newClient(), host);
|
||||||
refreshInterval = config.refresh;
|
refreshInterval = config.refresh;
|
||||||
hardRefreshInterval = config.hardRefresh;
|
hardRefreshInterval = config.hardRefresh;
|
||||||
schedulePoll();
|
schedulePoll();
|
||||||
|
|
Loading…
Reference in New Issue