当前位置: 首页>>代码示例>>Java>>正文


Java ManagedOperation类代码示例

本文整理汇总了Java中org.springframework.jmx.export.annotation.ManagedOperation的典型用法代码示例。如果您正苦于以下问题:Java ManagedOperation类的具体用法?Java ManagedOperation怎么用?Java ManagedOperation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ManagedOperation类属于org.springframework.jmx.export.annotation包,在下文中一共展示了ManagedOperation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doen

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * @return tijd te gaan.
 */
@ManagedOperation(description = "Verwachte looptijd te doen (minuten)")
public long tijdTeGaan() {
    final Date startDatum = selectieJobRunStatusService.getStatus().getStartDatum();
    if (startDatum == null) {
        return 0;
    }
    if (selectieJobRunStatusService.getStatus().getEindeDatum() != null) {
        return 0;
    }
    final long nu = new Date().getTime();
    final long duur = nu - startDatum.getTime();
    final double voortgang = voortgang();
    final double percentageTodo = PERC_100 - voortgang;

    final double doorloop = (duur / voortgang) * percentageTodo;
    return TimeUnit.MILLISECONDS.toMinutes((int) doorloop);
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:21,代码来源:SelectieJobRunStatusJMX.java

示例2: verwerkSnelheidSelectieTaken

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * @return verwerksnelheid selectietaken.
 */
@ManagedOperation(description = "selectie taken per minuut")
public long verwerkSnelheidSelectieTaken() {
    final Date startDatum = selectieJobRunStatusService.getStatus().getStartDatum();
    if (startDatum == null) {
        return 0;
    }
    final Date eindDatum = selectieJobRunStatusService.getStatus().getEindeDatum();
    final long nu = eindDatum != null ? eindDatum.getTime() : new Date().getTime();
    final int selectieTaken = selectieJobRunStatusService.getStatus().getSelectieTaakCount();
    final long tijd = TimeUnit.MILLISECONDS.toMinutes(nu - startDatum.getTime());
    if (tijd == 0) {
        return 0;
    }
    return selectieTaken / tijd;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:19,代码来源:SelectieJobRunStatusJMX.java

示例3: verwerkSnelheidBlobs

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * blobs pers minuut.
 * @return aantal blobs.
 */
@ManagedOperation(description = "blobs per minuut")
public long verwerkSnelheidBlobs() {
    final Date startDatum = selectieJobRunStatusService.getStatus().getStartDatum();
    if (startDatum == null) {
        return 0;
    }
    final Date eindDatum = selectieJobRunStatusService.getStatus().getEindeDatum();
    final long nu = eindDatum != null ? eindDatum.getTime() : new Date().getTime();
    final int selectieTaken = selectieJobRunStatusService.getStatus().getSelectieTaakCount();
    final int blobsPerBericht = configuratieService.getBlobsPerSelectieTaak();
    final long tijd = TimeUnit.MILLISECONDS.toMinutes(nu - startDatum.getTime());
    if (tijd == 0) {
        return 0;
    }
    return (selectieTaken * blobsPerBericht) / tijd;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:21,代码来源:SelectieJobRunStatusJMX.java

示例4: verwerkSnelheidSelectieSchrijfTaken

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * verwerksnelheid selectie schrijftaken.
 * @return aantal schrijftaken.
 */
@ManagedOperation(description = "selectie schrijf taken per minuut")
public long verwerkSnelheidSelectieSchrijfTaken() {
    final Date startDatum = selectieJobRunStatusService.getStatus().getStartDatum();
    if (startDatum == null) {
        return 0;
    }
    final Date eindDatum = selectieJobRunStatusService.getStatus().getEindeDatum();
    final long nu = eindDatum != null ? eindDatum.getTime() : new Date().getTime();
    final int selectieSchrijfTaken = selectieJobRunStatusService.getStatus().getAantalSchrijfTaken();
    final long tijd = TimeUnit.MILLISECONDS.toMinutes(nu - startDatum.getTime());
    if (tijd == 0) {
        return 0;
    }
    return selectieSchrijfTaken / tijd;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:20,代码来源:SelectieJobRunStatusJMX.java

示例5: milliseconds

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
@ManagedOperation(description = "Find flows within given timespan " +
		" containing searchExpression in the inbound flow message text")
@ManagedOperationParameters( {
        @ManagedOperationParameter(name = "timespan", description = "Last n milliseconds (e.g. 2000), "
                + "seconds (e.g. 2s), "
                + "minutes (e.g. 2m) or "
                + "hours (e.g. 2h)"),
        @ManagedOperationParameter(name = "searchExpression", description = "The query "
                + "for the inbound message's string representation.\n "
                + "e.g. \"+hl7 -test\" will match flows "
                + "with inbound message containing \"hl7\", not containing \"test\".\n"
                + "e.g. \"hl7\" will match flows "
                + "with inbound message containing the word \"hl7\".") })
public List<FlowInfo> findLastFlowsWithMessageText(String last, String searchExpression) {
    return flowManager.findFlows(finderCriteria(last, searchExpression));
}
 
开发者ID:oehf,项目名称:ipf-flow-manager,代码行数:17,代码来源:FlowManagerMBean.java

示例6: shutdown

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * Runs all refresh actions.
 */
@ManagedOperation(description = "Runs all recovery actions - to be used after a unclean server shutdown (kill)")
public void recover() {
  if (!stopRequested) {
    publishUnpublishedAlarms(); //unpublished alarms are sent to LASER
  }
  if (!stopRequested) {
    refreshStateTags(); //updates the tags with the current status
  }
  if (!stopRequested) {
    refreshDataTags(); //gets latest values from DAQ cache
  }
  if (!stopRequested) {
    notifyAllTagCacheListeners(); //also refreshes rules but not alarms (done with supervision)
  }
  //IMPORTANT: MUST BE CALLED LAST AS UPDATES TO RULES OR TAGS MAY HAVE OVERWRITTEN CURRENT SUPERVISION STATUS IF CACHE LISTENER
  //TAKES ACTION ON STATUS CONFIRMATION (ALTHOUGH THIS IS NOT RECOMMENDED - SEE TimCacheListener INTERFACE FOR DETAILS)
  if (!stopRequested) {
    refreshSupervisionStatus(); //generates new events with the current status; includes alarm callbacks!;
  }
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:24,代码来源:RecoveryManager.java

示例7: listeners

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * Notifies all Alarm cache listeners using the status confirmation call.
 * This will re-persist all the cache to the cache DB account (TIMPRO); re-publish
 * all alarm values to the C2MON clients; publish unpublished alarms to LASER (these
 * should normally be picked up by the publication-check thread in any case).
 *
 * <p>Notice that the alarm cache incorporates the current supervision status, unlike
 * the Tag caches, so it is not necessary to refresh the supervision status after this
 * call.
 */
@ManagedOperation(description = "Notifies all Alarm cache listeners (status confirmation).")
public void notifyAllAlarmCacheListeners() {
  log.info("Recovery task: notifying all alarm cache listeners (cache persistence to DB, re-publication to clients, publication to LASER if not already done)");
  for (Long key : alarmCache.getKeys()) {
    alarmCache.acquireWriteLockOnKey(key);
    try {
      Alarm alarm = alarmCache.getCopy(key);
      long eventTime = System.currentTimeMillis();
      alarmCache.notifyListenerStatusConfirmation(alarm, eventTime);
    } finally {
      alarmCache.releaseWriteLockOnKey(key);
    }
  }
  log.info("Recovery task: finished notifying all alarm cache listeners.");
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:26,代码来源:RecoveryManager.java

示例8: DB

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
@ManagedOperation(description = "Persists the current cache configurations to the DB (cache persistence). Ensures cache object runtime values & DB are synchronized.")
public void persistAllCacheConfigurationToDatabaseParallel() {
  try {
    List<Long> dataTagIdList = dataTagCache.getKeys();
    List<Long> controlTagIdList = controlTagCache.getKeys();
    List<Long> ruleTagIdList = ruleTagCache.getKeys();

    log.debug("Persisting of {} dataTags, {} controlTags and {} ruleTags configuration to the database", dataTagIdList.size(), controlTagIdList.size(), ruleTagIdList.size());

    controlTagCache.getKeys().parallelStream().forEach((key) -> controlTagLoaderDAO.updateConfig(controlTagCache.getCopy(key)));
    log.debug("Persisting controlTags configuration done");

    ruleTagCache.getKeys().parallelStream().forEach((key) -> ruleTagLoaderDAO.updateConfig(ruleTagCache.getCopy(key)));
    log.debug("Persisting of {} ruleTags configuration done", ruleTagIdList.size());

    dataTagCache.getKeys().parallelStream().forEach((key) -> dataTagLoaderDAO.updateConfig(dataTagCache.getCopy(key)));
    log.debug("Persisting of {} dataTags configuration done", dataTagIdList.size());


  } catch (Exception e) {
    log.warn("Error occurred whilst persisting all data tag configurations.", e);
  }
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:24,代码来源:TagConfigurationManager.java

示例9: DB

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
@ManagedOperation(description = "Persists the current cache configurations to the DB (cache persistence). Ensures cache object runtime values & DB are synchronized.")
public void persistAllCacheConfigurationToDatabase() {
  try {
    List<Long> tagIdList = commandTagCache.getKeys();

    log.debug("Persisting " + tagIdList.size() + " configuration of cache object(s) to the database (CommandTag)");
    int counter = 0, overall = 0;
    for (Long id : tagIdList) {
      commandTagDAO.updateCommandTag(commandTagCache.getCopy(id));
      counter++;
      overall++;
      if (counter >= tagIdList.size() * 0.1) {
        counter = 0;
        log.debug("JMX update progress: " + (int) (((overall * 1.0) / tagIdList.size()) * 100) + "%");
      }
    }
  } catch (Exception e){
    log.warn("Error occurred whilst persisting all command tag configurations.", e);
  }
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:21,代码来源:CommandTagConfigurationManager.java

示例10: pushReportProductSupplyForSelection

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
@ManagedOperation(description = "Pushes all product supply reports, identified by selection, from webui server to metasfresh server")
public void pushReportProductSupplyForSelection(final long bpartner_id, final long product_id, final String dayFromStr, final String dayToStr)
{
	try
	{
		final Date dayFrom = DateUtils.parseDayDate(dayFromStr);
		final Date dayTo = DateUtils.parseDayDate(dayToStr);

		final List<ProductSupply> productSupplies = productSuppliesService.getProductSupplies(bpartner_id, product_id, dayFrom, dayTo);
		if (productSupplies.isEmpty())
		{
			throw new RuntimeException("No supplies found");
		}

		final SyncProductSuppliesRequest request = createSyncProductSuppliesRequest(productSupplies);
		logger.debug("Pushing request: {}", request);
		process(request);
		logger.debug("Pushing request done");
	}
	catch (Exception e)
	{
		logger.error("Failed pushing product supplies for selection", e);
		throw Throwables.propagate(e);
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:26,代码来源:ServerSyncService.java

示例11: forceApiLogin

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
@ManagedOperation(description="Forces the interface to login again with the BuaBook API")
public String forceApiLogin() {
	apiAccess.invalidateAccess();
	
	Future<?> loginResult = taskExecutor.submit(login);
	
	try {
		loginResult.get();
	} catch (InterruptedException | ExecutionException e) {
		log.error("Failed to re-login after manual request. Error - " + e.getMessage(), e);
		return JmxResult.ERROR;
	}
	
	return JmxResult.OK;
}
 
开发者ID:BuaBook,项目名称:buabook-api-interface,代码行数:16,代码来源:ApiInterfaceManagement.java

示例12: printToFile

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
@ManagedOperation
public void printToFile(String portfId, String path) throws Exception {
    Optional<PortfolioReport> portfolioReport = reportingService.getPortfolioReport(PortfolioId.of(portfId));
    if (portfolioReport.isPresent()) {
        try (Writer out = new BufferedWriter(new OutputStreamWriter(
                new FileOutputStream(path), "UTF-8"))) {
            out.write(print(portfolioReport.get()));
        }
    } else {
        throw new RuntimeException("Portfolio Not Found =" + portfId);
    }
}
 
开发者ID:alexcwyu,项目名称:real-time-risk,代码行数:13,代码来源:PortfolioPrinter.java

示例13: displayDatastoreValue

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * Displays a configuration value in the datastore.
 *
 * @param configurationProperty the property name
 * @return see description
 */
@ManagedOperation(description = "Retrieves desired configuration property from datastore")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "configurationProperty", description = "The property key in the datastore") })
public String displayDatastoreValue(String configurationProperty) {
	ConfigurationValue configValue = configurationService.getValue(configurationProperty);
	return configValue != null ? configValue.getValue() : "unknown";
}
 
开发者ID:namics,项目名称:spring-configuration-support,代码行数:13,代码来源:JmxConfigurationManager.java

示例14: changeConfiguration

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * Changes the configuration value for a given property.
 *
 * @param configurationProperty property name
 * @param configurationValue    the new value
 */
@ManagedOperation(description = "Changes the desired configuration property")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "configurationProperty", description = "The property key in the datastore"),
		@ManagedOperationParameter(name = "configurationValue", description = "The new value to set for the property key") })
public void changeConfiguration(String configurationProperty,
                                String configurationValue) {
	configurationService.setValueFor(configurationProperty, configurationValue);
}
 
开发者ID:namics,项目名称:spring-configuration-support,代码行数:14,代码来源:JmxConfigurationManager.java

示例15: voortgang

import org.springframework.jmx.export.annotation.ManagedOperation; //导入依赖的package包/类
/**
 * Bepaalt het voortgangspercentage van de selectierun.
 *
 * @return voortgang.
 */
@ManagedOperation(description = "voortgang (%)")
public double voortgang() {
    final SelectieJobRunStatus status = selectieJobRunStatusService.getStatus();

    //blok 1; 70% aantal verwerk taken / totaal aantal verwerktaken
    final int totaal1 = status.getTotaalAantalSelectieTaken();
    final int afgerond1 = status.getVerwerkTakenKlaarCount();
    final boolean blok1Klaar = totaal1 == afgerond1;
    double factorBlok1 = ((double) afgerond1 / totaal1) * FACTOR_VOORTGANG_VERWERKERS;

    //blok 2: 10% aantal schrijf+afnemerindicatie taken / totaal aantal schrijf+afnemerindicatie taken
    double factorBlok2 = 0;
    boolean blok2Klaar = false;
    if (blok1Klaar) {
        final int totaal2 = status.getAantalSchrijfTaken() + status.getAantalPlaatsAfnemerindicatieTaken();
        final int afgerond2 = status.getSchrijfTakenKlaarCount() + status.getAantalPlaatsAfnemerindicatieKlaarTaken();
        blok2Klaar = totaal2 == afgerond2;
        factorBlok2 = blok2Klaar
                ? FACTOR_VOORTGANG_SCHRIJVEN_EN_AFNEMERINDICATIE
                        : ((double) afgerond2 / totaal2) * FACTOR_VOORTGANG_SCHRIJVEN_EN_AFNEMERINDICATIE;
    }

    //blok 3: 20% resultaattaken / totaal aantal resultaattaken klaar
    double factorBlok3 = 0;
    if (blok2Klaar) {
        final int totaal3 = status.getSelectieResultaatSchrijfTaakCount();
        final int afgerond3 = status.getSelectieResultaatSchrijfTaakResultaatCount();
        factorBlok3 = totaal3 == afgerond3
                ? FACTOR_VOORTGANG_RESULTAATBESTANDEN
                : ((double) afgerond3 / totaal3) * FACTOR_VOORTGANG_RESULTAATBESTANDEN;
    }

    return (factorBlok1 + factorBlok2 + factorBlok3) * PERC_100;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:40,代码来源:SelectieJobRunStatusJMX.java


注:本文中的org.springframework.jmx.export.annotation.ManagedOperation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。