[Fix] fix shutdown of handlers
This commit is contained in:
parent
15c9eb731d
commit
206c997f5a
|
@ -149,8 +149,6 @@ public class DefaultPlcHandler extends StrolchComponent implements PlcHandler, P
|
||||||
@Override
|
@Override
|
||||||
public void stop() throws Exception {
|
public void stop() throws Exception {
|
||||||
stopPlc();
|
stopPlc();
|
||||||
if (this.ctx != null)
|
|
||||||
getContainer().getPrivilegeHandler().invalidate(this.ctx.getCertificate());
|
|
||||||
|
|
||||||
this.run = false;
|
this.run = false;
|
||||||
if (this.messageSenderTask != null)
|
if (this.messageSenderTask != null)
|
||||||
|
@ -158,6 +156,9 @@ public class DefaultPlcHandler extends StrolchComponent implements PlcHandler, P
|
||||||
if (this.updateStateTask != null)
|
if (this.updateStateTask != null)
|
||||||
this.updateStateTask.cancel(true);
|
this.updateStateTask.cancel(true);
|
||||||
|
|
||||||
|
if (this.ctx != null)
|
||||||
|
getContainer().getPrivilegeHandler().invalidate(this.ctx.getCertificate());
|
||||||
|
|
||||||
super.stop();
|
super.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class PlcGwClientHandler extends StrolchComponent implements GlobalPlcLis
|
||||||
this.run = false;
|
this.run = false;
|
||||||
this.authenticated = false;
|
this.authenticated = false;
|
||||||
if (this.messageSenderTask != null)
|
if (this.messageSenderTask != null)
|
||||||
this.messageSenderTask.cancel(false);
|
this.messageSenderTask.cancel(true);
|
||||||
|
|
||||||
notifyPlcConnectionState(ConnectionState.Disconnected);
|
notifyPlcConnectionState(ConnectionState.Disconnected);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue