use of org.eclipse.milo.opcua.sdk.client.SessionActivityListener in project JBM by numen06.
the class OpcUaClientBean method startUp.
@Override
protected void startUp() throws Exception {
// add
log.info("OPCUA客户端[{}]开始启动执行守护线程", deviceId);
this.opcUaClient.addSessionActivityListener(new SessionActivityListener() {
@Override
public void onSessionActive(UaSession session) {
log.info("PLC[{}][{}]建立链接成功", deviceId, session.getSessionName());
}
@Override
public void onSessionInactive(UaSession session) {
log.info("PLC[{}][{}]断开了链接", deviceId, session.getSessionName());
}
});
}
Aggregations