예제 #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
 public EBI25DataSourceRT(EBI25DataSourceVO vo) {
   super(vo);
   this.vo = vo;
   setPollingPeriod(vo.getUpdatePeriodType(), vo.getUpdatePeriods(), false);
 }