org.ogema.core.application.ApplicationManager.getFrameworkTime()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.ogema.core.application.ApplicationManager.getFrameworkTime()方法的一些代码示例,展示了ApplicationManager.getFrameworkTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationManager.getFrameworkTime()方法的具体详情如下:
包路径:org.ogema.core.application.ApplicationManager
类名称:ApplicationManager
方法名:getFrameworkTime

ApplicationManager.getFrameworkTime介绍

暂无

代码示例

代码示例来源:origin: org.ogema.drivers/remote-rest-connector

/**
 * @return
 *         0, if task is not currently active, active duration in ms otherwise 
 */
public long getExecutionDuration() {
  final Long lastExec = this.lastExec;
  if (lastExec == null)
    return 0;
  return appman.getFrameworkTime() - lastExec;
}

代码示例来源:origin: org.ogema.drivers/remote-rest-connector

protected void triggerImmediately() {
  nextExec = appman.getFrameworkTime();
}

代码示例来源:origin: org.smartrplace.apps/smartrplace-util-proposed

private long getFrameworkTime() {
  if(appMan != null) return appMan.getFrameworkTime();
  return appManMinimal.getFrameworkTime();
}
protected final WidgetPage<?> page;

代码示例来源:origin: org.smartrplace.apps/smartrplace-util-proposed

protected long getFrameworkTime() {
  if(appMan != null) return appMan.getFrameworkTime();
  return appManMinimal.getFrameworkTime();
}
protected final WidgetPage<?> page;

代码示例来源:origin: org.ogema.drivers/remote-rest-connector

public final long advanceExecutionTime() {
  final long pushInterval = getValue(getUpdateIntervalResource());
  if (pushInterval < 2 * RemoteRestConnector.MIN_EXECUTION_STEP) {
    logger.warn("Pull/push interval too small: {} ms", pushInterval);
    nextExec = Long.MAX_VALUE;
  }
  else
    nextExec = appman.getFrameworkTime() + pushInterval;
  return nextExec;
}

代码示例来源:origin: org.ogema.tools/resource-manipulators

@Override
public void apply(TimeSeries schedule, long ageThreshold) {
  if (logger.isDebugEnabled())
    logger.debug("Schedule management removing " + schedule.getValues(Long.MIN_VALUE, am.getFrameworkTime() - ageThreshold).size()
      + " values from schedule {}", schedule);
  schedule.deleteValues(Long.MIN_VALUE, am.getFrameworkTime() - ageThreshold);
}

代码示例来源:origin: org.ogema.drivers/remote-rest-connector

@Override
public ConnectionTask call() throws Exception {
  lastExec = appman.getFrameworkTime();
  try {
    final int code = execute();
    if (code >= 300) 
      throw new RuntimeException("Http request for " + con.remotePath() + " not successful: " + code);
    else
      logger.debug(this.getClass().getSimpleName()+" request for {}: {}",con.remotePath(), code);
  } finally {
    lastExec = null;
    nextExec = appman.getFrameworkTime() + getValue(getUpdateIntervalResource());
  }
  return this;
}

代码示例来源:origin: org.smartrplace.apps/smartrplace-util-proposed

private int performAttempt() {
  int code;
  if((serverUnavailableUntil != null) && 
      (serverUnavailableUntil.getValue() > appMan.getFrameworkTime())) {
    code = -2;
  } else {
    code = FileUploadUtil.sendFile(sourceToUse, dest, user, pw, serverPortAddress, appMan);            
    if(((code == -2)||(code == -3))&&(serverUnavailableUntil != null)) {
      serverUnavailableUntil.setValue(appMan.getFrameworkTime()+retryInterval/2);
    }
  }
  attemptCount++;
  setStatus(code);
  return code;
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

protected void setLastUpdateTime() {
  TreeElement te = getTreeElement();
  while (te.isReference()) {
    te = te.getReference();
  }
  te.setLastModified(resMan.getApplicationManager().getFrameworkTime());
}

代码示例来源:origin: org.ogema.tools/grafana-base

@Override
public void start(ApplicationManager am) {
  this.am = am;
  String packagePath = "org/ogema/tools/grafana/base/grafana-1.9.1";
  WEB_RES_PATH = am.getWebAccessManager().registerWebResourcePath("", packagePath);
  APP_STARTTIME = am.getFrameworkTime();
  //    	WEB_RES_PATH = am.getWebAccessManager().registerWebResource("/org/ogema/tools/grafana-base" , packagePath);      
  am.getLogger().debug("Grafana base resources registered under " + WEB_RES_PATH);
  am.getWebAccessManager().registerStartUrl(null); // remove app from framework GUI
}

代码示例来源:origin: org.ogema.tools/resource-manipulators

private static void persistLogData(SingleValueResource resource, ApplicationManager am) {
  long currentTime = am.getFrameworkTime();
  RecordedData rd = getHistoricalData(resource);
  List<SampledValue> values = rd.getValues(currentTime - LOG_DATA_LIFETIME, currentTime);
  AbsoluteSchedule historicalDataSchedule = getHistoricalDataSchedule(resource).create();
  // replaces log data values by explicitly set values, which are retained after expiry of the log data
  historicalDataSchedule.addValues(values); 
  historicalDataSchedule.activate(false);
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

protected void handleResourceUpdateInternal(final boolean valueChanged) {
  setLastUpdateTime();
  if (!el.isActive())
    return;
  resMan.getDatabaseManager().getElementInfo(el).fireResourceChanged(this,
      resMan.getApplicationManager().getFrameworkTime(), valueChanged);
}

代码示例来源:origin: org.ogema.tools/resource-manipulators

@Override
public void apply(TimeSeries schedule, long ageThreshold) {
  long current = am.getFrameworkTime();
  long boundary;
  try {
    boundary = subtract(current, ageThreshold);
  } catch (ArithmeticException e) {
    logger.error("Arithmetic exception",e);
    return;
  }
  FloatTimeSeries fts = new FloatTreeTimeSeries();
  fts.read(schedule, Long.MIN_VALUE, boundary);
  schedule.replaceValues(Long.MIN_VALUE, boundary, fts.downsample(Long.MIN_VALUE, boundary, minInterval));
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

protected void handleResourceUpdate(boolean valueChanged) {
  setLastUpdateTime();
  if (!el.isActive()) {
    return;
  }
  resMan.getDatabaseManager().getElementInfo(getEl()).fireResourceChanged(this,
      resMan.getApplicationManager().getFrameworkTime(), valueChanged);
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public boolean addValues(Collection<SampledValue> values, long timeOfCalculation) {
  if (!exists() || !hasWriteAccess()) {
    return false;
  }
  checkWritePermission();
  m_dbMan.startTransaction();
  try {
    getSchedule().addValues(values, timeOfCalculation);
  } finally {
    m_dbMan.finishTransaction();
  }
  getSchedule().setLastUpdateTime(m_appMan.getFrameworkTime());
  handleResourceUpdate(true);
  return true;
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public boolean deleteValues(long startTime, long endTime) {
  if (!exists() || !hasWriteAccess()) {
    return false;
  }
  checkWritePermission();
  m_dbMan.startTransaction();
  try {
    getSchedule().deleteValues(startTime, endTime);
  } finally {
    m_dbMan.finishTransaction();
  }
  getSchedule().setLastUpdateTime(m_appMan.getFrameworkTime());
  handleResourceUpdate(true);
  return true;
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public boolean replaceValues(long startTime, long endTime, Collection<SampledValue> values) {
  if (!exists() || !hasWriteAccess()) {
    return false;
  }
  checkWritePermission();
  m_dbMan.startTransaction();
  try {
    getSchedule().replaceValues(startTime, endTime, values);
  } finally {
    m_dbMan.finishTransaction();
  }
  getSchedule().setLastUpdateTime(m_appMan.getFrameworkTime());
  handleResourceUpdate(true);
  return true;
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public boolean addValues(Collection<SampledValue> values) {
  if (!exists() || !hasWriteAccess()) {
    return false;
  }
  checkWritePermission();
  m_dbMan.startTransaction();
  try {
    getSchedule().addValues(values);
  } finally {
    m_dbMan.finishTransaction();
  }
  getSchedule().setLastUpdateTime(m_appMan.getFrameworkTime());
  handleResourceUpdate(true);
  return true;
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public boolean replaceValuesFixedStep(long startTime, List<Value> values, long stepSize) {
  if (!exists() || !hasWriteAccess()) {
    return false;
  }
  checkWritePermission();
  m_dbMan.startTransaction();
  try {
    getSchedule().replaceValuesFixedStep(startTime, values, stepSize);
  } finally {
    m_dbMan.finishTransaction();
  }
  getSchedule().setLastUpdateTime(m_appMan.getFrameworkTime());
  handleResourceUpdate(true);
  return true;
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public boolean addValue(long timestamp, Value value, long timeOfCalculation) {
  if (!exists() || !hasWriteAccess()) {
    return false;
  }
  checkWritePermission();
  m_dbMan.startTransaction();
  try {
    getSchedule().addValue(timestamp, value, timeOfCalculation);
  } finally {
    m_dbMan.finishTransaction();
  }
  getSchedule().setLastUpdateTime(m_appMan.getFrameworkTime());
  handleResourceUpdate(true);
  return true;
}

相关文章