本文整理汇总了Java中org.springframework.jmx.export.annotation.ManagedOperationParameter类的典型用法代码示例。如果您正苦于以下问题:Java ManagedOperationParameter类的具体用法?Java ManagedOperationParameter怎么用?Java ManagedOperationParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ManagedOperationParameter类属于org.springframework.jmx.export.annotation包,在下文中一共展示了ManagedOperationParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: milliseconds
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的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));
}
示例2: subscribe
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description = "Subscribes to market data. The subscription will be non-persistent."
+ " If the server already subscribes to the given market data, this method is a "
+ " no-op. Returns the name of the JMS topic market data will be published on.")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "securityUniqueId", description = "Security unique ID. Server type dependent.)") })
public String subscribe(String securityUniqueId) {
try {
LiveDataSubscriptionResponse response = getServer().subscribe(securityUniqueId);
if (response.getSubscriptionResult() != LiveDataSubscriptionResult.SUCCESS) {
throw new RuntimeException("Unsuccessful subscription: " + response.getUserMessage());
}
return response.getTickDistributionSpecification();
} catch (RuntimeException e) {
s_logger.error("subscribe(" + securityUniqueId + ") failed", e);
throw new RuntimeException(e.getMessage());
}
}
示例3: subscribePersistently
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description = "Subscribes to market data. The subscription will be persistent."
+ " If the server already subscribes to the given market data, this method will make the "
+ " subscription persistent. Returns the name of the JMS topic market data will be published on.")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "securityUniqueId", description = "Security unique ID. Server type dependent.)") })
public String subscribePersistently(String securityUniqueId) {
try {
LiveDataSpecification spec = getServer().getLiveDataSpecification(securityUniqueId);
LiveDataSubscriptionResponse response = getServer().subscribe(spec, true);
if (response.getSubscriptionResult() != LiveDataSubscriptionResult.SUCCESS) {
throw new RuntimeException("Unsuccessful subscription: " + response.getUserMessage());
}
return response.getTickDistributionSpecification();
} catch (RuntimeException e) {
s_logger.error("subscribe(" + securityUniqueId + ") failed", e);
throw new RuntimeException(e.getMessage());
}
}
示例4: showIndicator
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
/**
* Indicatorを表示します
*/
@ManagedOperation
@ManagedOperationParameters({
@ManagedOperationParameter(name = "indicatorTypeStr", description = "IndicatorType.name()"),
@ManagedOperationParameter(name = "symbolStr", description = "Symbol.name()"),
@ManagedOperationParameter(name = "periodStr", description = "Period.name()")})
public String showIndicator(String indicatorTypeStr, String symbolStr, String periodStr) {
try {
IndicatorType indicatorType = IndicatorType.valueOf(indicatorTypeStr);
Symbol symbol = Symbol.valueOf(symbolStr);
Period period = Period.valueOf(periodStr);
String indicatorStr = indicatorDataHolder.getIndicator(indicatorType, symbol, period).getDataString();
return String.format("%s-%s-%s %s", indicatorType.name(), symbol.name(), period.name(), indicatorStr);
} catch (Exception e) {
return String.format("Failed to Execute : %s, %s, %s \n\n%s", indicatorTypeStr, symbolStr, periodStr, ExceptionUtility.getStackTraceString(e));
}
}
示例5: deployModelJMX
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@Override
@ManagedOperation
@ManagedOperationParameters({
@ManagedOperationParameter(name = "modelTypeStr", description = "value of ModelType.name()"),
@ManagedOperationParameter(name = "modelVersionStr", description = "value of ModelVersion.name()"),
@ManagedOperationParameter(name = "symbolStr", description = "value of Symbol.name()") })
public String deployModelJMX(String modelTypeStr, String modelVersionStr, String symbolStr) {
try {
ModelType modelType = ModelType.valueOf(modelTypeStr);
Symbol symbol = Symbol.valueOf(symbolStr);
// deploy
IModel model = deployModel(modelType, modelVersionStr, symbol);
return String.format("Successfully deploy model : %s", model.getModelInformation());
} catch (ModelInitializeException e) {
return String.format("Failed to depoly model : %s, %s, %s \n\n%s", modelTypeStr, modelVersionStr, symbolStr, ExceptionUtility.getStackTraceString(e));
}
}
示例6: setUserEnabled
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@Override
@PerfLogged
@WithinSingleTransaction
@ManagedOperation(description = "Set or clear whether this account is enabled. "
+ "Disabled accounts cannot be used to log in.")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "username", description = "The username to adjust."),
@ManagedOperationParameter(name = "enabled", description = "Whether to enable the account.") })
public void setUserEnabled(String username, boolean enabled) {
User u = getById(username);
if (u != null) {
u.setDisabled(!enabled);
log.info((enabled ? "enabling" : "disabling") + " user " + username);
epoch++;
}
}
示例7: setUserAdmin
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@Override
@PerfLogged
@WithinSingleTransaction
@ManagedOperation(description = "Set or clear the mark on an account that indicates "
+ "that it has administrative privileges.")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "username", description = "The username to adjust."),
@ManagedOperationParameter(name = "admin", description = "Whether the account has admin privileges.") })
public void setUserAdmin(String username, boolean admin) {
User u = getById(username);
if (u != null) {
u.setAdmin(admin);
log.info((admin ? "enabling" : "disabling") + " user " + username
+ " admin status");
epoch++;
}
}
示例8: setUserLocalUser
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@Override
@PerfLogged
@WithinSingleTransaction
@ManagedOperation(description = "Change what local system account to use for a server account.")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "username", description = "The username to adjust."),
@ManagedOperationParameter(name = "password", description = "The new local user account use.") })
public void setUserLocalUser(String username, String localUsername) {
User u = getById(username);
if (u != null) {
u.setLocalUsername(localUsername);
log.info("mapping user " + username + " to local account "
+ localUsername);
epoch++;
}
}
示例9: parseQuery
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description="Parse XQuery. Return array of parameter names, if any")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "query", description = "A query request provided in XQuery syntax"),
@ManagedOperationParameter(name = "props", description = "Query processing properties")})
public String[] parseQuery(String query, Properties props) {
XQPreparedExpression xqpExp = null;
try {
XQStaticContext ctx = xqConn.getStaticContext();
props2Context(schemaManager.getEntity().getProperties(), ctx);
props2Context(props, ctx);
xqpExp = xqConn.prepareExpression(query, ctx);
QName[] vars = xqpExp.getAllExternalVariables();
String[] result = null;
if (vars != null) {
result = new String[vars.length];
for (int i=0; i < vars.length; i++) {
result[i] = vars[i].toString();
}
}
xqpExp.close();
return result;
} catch (XQException ex) {
logger.error("parseQuery.error", ex);
throw new RuntimeException(ex.getMessage());
}
}
示例10: updateProperties
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description="Update Schema properties")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "properties", description = "Schema properties: key/value pairs separated by semicolon")})
public boolean updateProperties(String properties) {
Schema schema = getEntity();
if (schema != null) {
Properties props;
try {
props = PropUtils.propsFromString(properties);
} catch (IOException ex) {
logger.error("updateProperties.error: ", ex);
return false;
}
Object result = entityCache.executeOnKey(entityName, new SchemaUpdater(schema.getVersion(),
getCurrentUser(), true, props));
logger.trace("updateProperties; execution result: {}", result);
return result != null;
}
return false;
}
示例11: node
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description="Initiates schema on Cluster node(-s)")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "schemaName", description = "Schema name to add")})
public void addSchema(String schemaName) {
Node node = getEntity();
String schemas = node.getOption(pn_cluster_node_schemas);
if (schemas != null) {
if (schemas.length() > 0) {
schemas = schemas + " " + schemaName;
} else {
schemas = schemaName;
}
} else {
schemas = schemaName;
}
setOption(pn_cluster_node_schemas, schemas);
}
示例12: registerModel
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description="Register Model")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "dataFormat", description = "DataFormat responsible for corresponding Schema"),
@ManagedOperationParameter(name = "modelFile", description = "A full path to Schema file to register")})
public int registerModel(String dataFormat, String modelFile) {
logger.trace("registerModel.enter;");
long stamp = System.currentTimeMillis();
ModelRegistrator task = new ModelRegistrator(dataFormat, modelFile, true);
Future<Integer> result = execService.submit(task);
int cnt = 0;
try {
cnt = result.get();
} catch (InterruptedException | ExecutionException ex) {
logger.error("", ex);
}
stamp = System.currentTimeMillis() - stamp;
logger.trace("registerModel.exit; returning: {}; timeTaken: {}", cnt, stamp);
return cnt;
}
示例13: registerModels
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description="Register Schemas")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "dataFormat", description = "DataFormat responsible for corresponding Schema"),
@ManagedOperationParameter(name = "schemaCatalog", description = "A full path to the directory containing Schema files to register")})
public int registerModels(String dataFormat, String modelCatalog) {
logger.trace("registerModels.enter;");
long stamp = System.currentTimeMillis();
ModelRegistrator task = new ModelRegistrator(dataFormat, modelCatalog, false);
Future<Integer> result = execService.submit(task);
int cnt = 0;
try {
cnt = result.get();
} catch (InterruptedException | ExecutionException ex) {
logger.error("", ex);
}
stamp = System.currentTimeMillis() - stamp;
logger.trace("registerModels.exit; returning: {}; timeTaken: {}", cnt, stamp);
return cnt;
}
示例14: dropTrigger
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description="Removes an existing Trigger")
@ManagedOperationParameters({@ManagedOperationParameter(name = "className", description = "Trigger className to delete")})
public void dropTrigger(String className) {
logger.trace("dropTrigger.enter;");
long stamp = System.currentTimeMillis();
if (!schemaManager.deleteTrigger(className)) {
throw new IllegalStateException("Trigger '" + className + "' in schema '" + schemaName + "' does not exist");
}
TriggerRemover task = new TriggerRemover(className);
Map<Member, Future<Boolean>> results = execService.submitToAllMembers(task);
int cnt = 0;
for (Map.Entry<Member, Future<Boolean>> entry: results.entrySet()) {
try {
if (entry.getValue().get()) {
cnt++;
}
} catch (InterruptedException | ExecutionException ex) {
logger.error("dropTrigger.error; ", ex);
}
}
stamp = System.currentTimeMillis() - stamp;
logger.trace("dropTrigger.exit; trigger deleted on {} members; timeTaken: {}", cnt, stamp);
}
示例15: clear
import org.springframework.jmx.export.annotation.ManagedOperationParameter; //导入依赖的package包/类
@ManagedOperation(description="delete all Schema documents")
@ManagedOperationParameters({
@ManagedOperationParameter(name = "evictOnly", description = "Delete from Cache or from Cache and CacheStore too")})
public boolean clear(boolean evictOnly) {
SchemaDocCleaner task = new SchemaDocCleaner(schemaName, evictOnly);
Map<Member, Future<Boolean>> results = execService.submitToAllMembers(task);
boolean result = true;
for (Map.Entry<Member, Future<Boolean>> entry: results.entrySet()) {
try {
if (!entry.getValue().get()) {
result = false;
}
} catch (InterruptedException | ExecutionException ex) {
logger.error("clear.error; ", ex);
//throw new RuntimeException(ex.getMessage());
}
}
return result;
}