本文整理汇总了Java中org.jolokia.client.exception.J4pException类的典型用法代码示例。如果您正苦于以下问题:Java J4pException类的具体用法?Java J4pException怎么用?Java J4pException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
J4pException类属于org.jolokia.client.exception包,在下文中一共展示了J4pException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ping
import org.jolokia.client.exception.J4pException; //导入依赖的package包/类
@Override
public boolean ping() {
if (jolokia == null) {
throw new IllegalStateException("Need to connect to remote jolokia first");
}
J4pVersionResponse vr;
try {
vr = jolokia.execute(new J4pVersionRequest());
return vr != null && vr.getValue() != null;
} catch (J4pException e) {
return false;
}
}
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:DefaultJolokiaCamelController.java
示例2: fetchMbeanMetadata
import org.jolokia.client.exception.J4pException; //导入依赖的package包/类
private void fetchMbeanMetadata(final J4pClient client) {
try {
J4pListRequest request = new J4pListRequest(new ObjectName(MBEAN_JAVA_LANG_MEMORY));
logger().trace("Listing: {}", MBEAN_JAVA_LANG_MEMORY);
client.execute(request); // Ignore response
} catch (J4pException | MalformedObjectNameException e) {
logger().error("Failed to execute list request: {}", MBEAN_JAVA_LANG_MEMORY, e);
}
}
开发者ID:clidev,项目名称:spike.x,代码行数:10,代码来源:Jolokia.java
示例3: serverType
import org.jolokia.client.exception.J4pException; //导入依赖的package包/类
/**
* Connects to Jolokia and tries to introspect the server type e.g., Jetty, Tomcat etc.
*
* @return the server type
* @throws nz.org.geonet.metrics.exception.ConnectionException
*
* @see ServerType
*/
String serverType() throws ConnectionException {
String result = ServerType.UnknownJVM.name();
try {
J4pVersionRequest request = new J4pVersionRequest();
J4pVersionResponse response = client.execute(request);
if (response != null && response.getValue() != null) {
HashMap responseMap = response.getValue();
if (responseMap.containsKey("info")) {
HashMap info = (HashMap) responseMap.get("info");
// TODO - don't check the version at the moment. Don't know how important this is yet.
// e.g., {"product":"tomcat","vendor":"Apache","version":"6.0.37"}
if (info.containsKey("product") && ServerType.Jetty.name().toLowerCase().matches(info.get("product").toString().toLowerCase())) {
result = ServerType.Jetty.name();
} else if (info.containsKey("product") && ServerType.Tomcat.name().toLowerCase().matches(info.get("product").toString().toLowerCase())) {
result = ServerType.Tomcat.name();
}
}
}
} catch (J4pException e) {
throw new ConnectionException("problem connecting to the Jolokia agent " + URL);
}
return result;
}
开发者ID:GeoNet,项目名称:app-server-metrics,代码行数:39,代码来源:MetricsClient.java
示例4: getSingleLogbackContext
import org.jolokia.client.exception.J4pException; //导入依赖的package包/类
public static LogbackContext getSingleLogbackContext(J4pClient client) throws J4pException {
Objects.requireNonNull(client, "client should not be null");
Map<String, Object> logbacks = client.execute(new J4pListRequest(LOGBACK_PATH)).getValue();
if(logbacks.size() != 1) {
throw new IllegalStateException("expected: a single logback context");
}
return new LogbackContext(client, LOGBACK_PATH + ":" + logbacks.keySet().iterator().next());
}
开发者ID:IDgis,项目名称:geo-publisher,代码行数:12,代码来源:LogbackContext.java
示例5: fetchData
import org.jolokia.client.exception.J4pException; //导入依赖的package包/类
private Iterable<?> fetchData() throws MalformedObjectNameException, J4pException {
final List<J4pReadRequest> requests = getRequests();
final List<J4pResponse<J4pReadRequest>> response = client.execute(requests);
return toValues(response);
}
开发者ID:HendrikSP,项目名称:jolokia-csv,代码行数:6,代码来源:JolokiaGatherer.java
注:本文中的org.jolokia.client.exception.J4pException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论