Пример #1
0
  //
  // /
  // / Lifecycle
  // /
  //
  @Override
  public void initialize() {
    try {
      modbusMaster =
          EBI25Constants.initModbusMaster(
              vo.getHost(), vo.getPort(), vo.isKeepAlive(), vo.getTimeout(), vo.getRetries(), this);

      // Deactivate any existing event.
      returnToNormal(DATA_SOURCE_EXCEPTION_EVENT, System.currentTimeMillis());
    } catch (Exception e) {
      raiseEvent(
          DATA_SOURCE_EXCEPTION_EVENT,
          System.currentTimeMillis(),
          true,
          getLocalExceptionMessage(e));
      LOG.debug("Error while initializing data source", e);
      return;
    }

    super.initialize();
  }
Пример #2
0
 @Override
 public void terminate() {
   super.terminate();
   EBI25Constants.destroyModbusMaster(modbusMaster);
 }