本文整理汇总了Java中org.rhq.core.domain.configuration.Configuration.getSimpleValue方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getSimpleValue方法的具体用法?Java Configuration.getSimpleValue怎么用?Java Configuration.getSimpleValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rhq.core.domain.configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.getSimpleValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildResourceKey
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
protected String buildResourceKey(Configuration pluginConfig, ResourceDiscoveryContext context, ProcessInfo process) {
final String resourceKeyProperty = getResourceKeyProperty(pluginConfig);
final String keyString;
if (process == null) {
keyString = pluginConfig.getSimpleValue(resourceKeyProperty);
} else {
keyString = getSystemPropertyValue(process, resourceKeyProperty);
}
if (keyString == null || keyString.isEmpty()) {
if (process == null) {
throw new InvalidPluginConfigurationException("Missing required property" + resourceKeyProperty);
} else {
throw new InvalidPluginConfigurationException("Process [" + process.getPid() + "] with command line "
+ Arrays.toString(process.getCommandLine())
+ " cannot be discovered, because it does not specify "
+ "-D" + resourceKeyProperty + "=UNIQUE_KEY");
}
}
return context.getResourceType().getName() + "{" + keyString + "}";
}
示例2: doStart
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
protected void doStart() throws InvalidPluginConfigurationException {
dataSourceComponent = getParent();
adminOperations = dataSourceComponent.getServer().getMBeanClient("WebSphere:type=AdminOperations,*").getProxy(AdminOperations.class);
Configuration config = getResourceContext().getPluginConfiguration();
principal = config.getSimpleValue("principal", null);
credentials = config.getSimpleValue("credentials", null);
try {
Class.forName("com.ibm.db2.jcc.DB2SimpleDataSource");
} catch (ClassNotFoundException ex) {
log.error("DB2 monitor unavailable: JDBC driver not present in the class path");
throw new Error(ex);
}
if (principal != null) {
measurementFacetSupport = new MeasurementFacetSupport(this);
measurementFacetSupport.setDefaultHandler(new SnapshotMeasurementGroupHandler(this, adminOperations));
measurementFacetSupport.addHandler("acr", new ACRMeasurementGroupHandler(this));
}
}
示例3: initializeLoggingProvider
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
private void initializeLoggingProvider(Configuration pluginConfiguration) throws Error {
loggingProviderName = pluginConfiguration.getSimpleValue("loggingProvider", "none");
Class<? extends LoggingProvider> loggingProviderClass = loggingProviderClasses.get(loggingProviderName);
if (loggingProviderClass == null) {
throw new InvalidPluginConfigurationException("Unknown logging provider '" + loggingProviderName + "'");
}
if (log.isDebugEnabled()) {
log.debug("Creating logging provider: name=" + loggingProviderName + ", class="
+ loggingProviderClass.getName());
}
try {
loggingProvider = loggingProviderClass.newInstance();
} catch (Exception ex) {
throw new Error("Failed to instantiate " + loggingProviderClass, ex);
}
}
示例4: invoke
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
@Override
public ControlResults invoke(String name, Configuration conf) {
log.debug("invoke " + name);
try {
if (name.equals("ackup")) {
String subject = conf.getSimpleValue("subject", "rhq");
ackup(subject);
} else if (name.equals("refire")) {
refire();
} else {
throw new IllegalArgumentException(name);
}
return new ControlResults();
} catch (Exception e) {
log.error("failed to invoke " + name, e);
ControlResults cr = new ControlResults();
cr.setError(e);
return cr;
}
}
示例5: start
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
@Override
public void start(ResourceContext<ResourceComponent<?>> context) throws InvalidPluginConfigurationException, Exception {
Configuration config = context.getPluginConfiguration();
String path = config.getSimpleValue(JAVA_LIBRARY_PATH, "");
if (!path.isEmpty()) {
try {
log.debug("addLibraryPath " + path);
addLibraryPath(path);
} catch (Exception e) {
log.warn("cannot set " + JAVA_LIBRARY_PATH, e);
}
}
connectionProvider = new TimesTenPooledConnectionProvider(config);
}
示例6: discoverResource
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
@Override
public DiscoveredResourceDetails discoverResource(Configuration conf,
ResourceDiscoveryContext<ResourceComponent<?>> context)
throws InvalidPluginConfigurationException {
String port = conf.getSimpleValue(PORT);
if (port == null)
throw new InvalidPluginConfigurationException("null port");
String version;
try {
version = version(conf);
} catch (Exception e) {
throw new InvalidPluginConfigurationException("port check", e);
}
DiscoveredResourceDetails drd = new DiscoveredResourceDetails(
context.getResourceType(),
port,
"Splunk",
version,
"Splunk instance; could be forwarder",
conf, null);
return drd;
}
示例7: discoverResource
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
@Override
public DiscoveredResourceDetails discoverResource(Configuration config, ResourceDiscoveryContext rdc)
throws InvalidPluginConfigurationException {
String portStr = config.getSimpleValue(RedisComponent.PORT, null);
if (portStr == null)
throw new InvalidPluginConfigurationException("port not set");
int port = Integer.parseInt(portStr);
Client2 client = new Client2("localhost", port);
Properties props;
try {
props = client.infoAll();
log.info("discovered redis " + port);
} finally {
client.disconnect();
}
String name = "redis " + port;
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
rdc.getResourceType(),
name, // database key
name, // UI name
props.getProperty("redis_version"), // Version
name,
config,
null); // process info
return detail;
}
示例8: handleInvokeSendMessageToDLA
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
private OperationResult handleInvokeSendMessageToDLA(Configuration parameters, EmsBean emsBean) throws Exception {
EmsOperation operation = findOperation(emsBean, SEND_MESSAGE_TO_DLA_OPERATION, 1);
String mid = parameters.getSimpleValue("messageID");
final Object opResult = operation.invoke(Long.valueOf(mid));
final OperationResult result = new OperationResult();
result.getComplexResults().put(new PropertySimple("result", opResult.toString()));
return result;
}
示例9: getConfigWithJmxServiceUrl
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
protected Configuration getConfigWithJmxServiceUrl(ResourceDiscoveryContext context, ProcessInfo process) {
Configuration configuration = context.getDefaultPluginConfiguration();
if (configuration.getSimpleValue(JMXDiscoveryComponent.CONNECTOR_ADDRESS_CONFIG_PROPERTY) == null) {
throw new InvalidPluginConfigurationException("Missing Property " +
JMXDiscoveryComponent.CONNECTOR_ADDRESS_CONFIG_PROPERTY +
" in Resource type " + context.getResourceType().getName());
}
return configuration;
}
示例10: handleInvokeRemoveMessages
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
private OperationResult handleInvokeRemoveMessages(Configuration parameters, EmsBean emsBean) throws Exception {
EmsOperation operation = findOperation(emsBean, REMOVE_MESSAGES_OPERATION, 2);
String flush = parameters.getSimpleValue("flushLimit");
Integer flushLimit = Integer.valueOf(flush);
String selector = parameters.getSimpleValue("filter");
final Object opResult = operation.invoke(flushLimit, selector);
final OperationResult result = new OperationResult();
result.getComplexResults().put(new PropertySimple("result", opResult.toString()));
return result;
}
示例11: handleInvokeListMessagesAsJSON
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
private OperationResult handleInvokeListMessagesAsJSON(Configuration parameters, EmsBean emsBean) throws Exception {
EmsOperation operation = findOperation(emsBean, LIST_MESSAGES_AS_JSON_OPERATION, 1);
String selector = parameters.getSimpleValue("filter");
final Object opResult = operation.invoke(selector);
final OperationResult result = new OperationResult();
result.getComplexResults().put(new PropertySimple("result", opResult.toString()));
return result;
}
示例12: handleInvokeMoveMessage
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
private OperationResult handleInvokeMoveMessage(Configuration parameters, EmsBean emsBean) throws Exception {
EmsOperation operation = findOperation(emsBean, MOVE_MESSAGE_OPERATION, 3);
String mid = parameters.getSimpleValue("messageID");
Long midLong = Long.valueOf(mid);
String otherQueue = parameters.getSimpleValue("otherQueueName");
String rejectDup = parameters.getSimpleValue("rejectDuplicates");
Boolean isRejectDup = Boolean.valueOf(rejectDup);
final Object opResult = operation.invoke(midLong, otherQueue, isRejectDup);
final OperationResult result = new OperationResult();
result.getComplexResults().put(new PropertySimple("result", opResult.toString()));
return result;
}
示例13: handleAddAddressSettings
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
private OperationResult handleAddAddressSettings(Configuration parameters, EmsBean emsBean) throws Exception {
EmsOperation operation = findOperation(emsBean, ADD_ADDRESS_SETTINGS_OPERATION, 26);
Object[] arguments = new Object[] { parameters.getSimpleValue("addressMatch"),
parameters.getSimpleValue("DLA"),
parameters.getSimpleValue("expiryAddress"),
toLong(parameters.getSimpleValue("expiryDelay")),
toBoolean(parameters.getSimpleValue("lastValueQueue")),
toInt(parameters.getSimpleValue("deliveryAttempts")),
toLong(parameters.getSimpleValue("maxSizeBytes")),
toInt(parameters.getSimpleValue("pageSizeBytes")),
toInt(parameters.getSimpleValue("pageMaxCacheSize")),
toLong(parameters.getSimpleValue("redeliveryDelay")),
toDouble(parameters.getSimpleValue("redeliveryMultiplier")),
toLong(parameters.getSimpleValue("maxRedeliveryDelay")),
toLong(parameters.getSimpleValue("redistributionDelay")),
toBoolean(parameters.getSimpleValue("sendToDLAOnNoRoute")),
parameters.getSimpleValue("addressFullMessagePolicy"),
toLong(parameters.getSimpleValue("slowConsumerThreshold")),
toLong(parameters.getSimpleValue("slowConsumerCheckPeriod")),
parameters.getSimpleValue("slowConsumerPolicy"),
toBoolean(parameters.getSimpleValue("autoCreateJmsQueues")),
toBoolean(parameters.getSimpleValue("autoDeleteJmsQueues")),
toBoolean(parameters.getSimpleValue("autoCreateJmsTopics")),
toBoolean(parameters.getSimpleValue("autoDeleteJmsTopics")),
toBoolean(parameters.getSimpleValue("autoCreateQueues")),
toBoolean(parameters.getSimpleValue("autoDeleteQueues")),
toBoolean(parameters.getSimpleValue("autoCreateAddresses")),
toBoolean(parameters.getSimpleValue("autoDeleteAddresses"))
};
try {
operation.invoke(arguments);
final OperationResult result = new OperationResult("result");
return result;
} catch (Exception e) {
throw e;
}
}
示例14: handleListAddresses
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
private OperationResult handleListAddresses(Configuration parameters, EmsBean emsBean) throws Exception {
EmsOperation operation = findOperation(emsBean, LIST_ADDRESSES_OPERATION, 1);
String separator = parameters.getSimpleValue("separator");
final Object opResult = operation.invoke(separator);
final OperationResult result = new OperationResult("result");
result.getComplexResults().put(new PropertySimple("result", opResult.toString()));
return result;
}
示例15: handleCreateAddress
import org.rhq.core.domain.configuration.Configuration; //导入方法依赖的package包/类
private OperationResult handleCreateAddress(Configuration parameters, EmsBean emsBean) throws Exception {
EmsOperation operation = findOperation(emsBean, CREATE_ADDRESS_OPERATION, 2);
String name = parameters.getSimpleValue("name");
String routingTypes = parameters.getSimpleValue("routingTypes");
final Object opResult = operation.invoke(name, routingTypes);
final OperationResult result = new OperationResult();
result.getComplexResults().put(new PropertySimple("result", opResult.toString()));
return result;
}