本文整理匯總了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例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!;
}
}
示例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.");
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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";
}
示例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);
}
示例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;
}