當前位置: 首頁>>代碼示例>>Java>>正文


Java J4pExecResponse類代碼示例

本文整理匯總了Java中org.jolokia.client.request.J4pExecResponse的典型用法代碼示例。如果您正苦於以下問題:Java J4pExecResponse類的具體用法?Java J4pExecResponse怎麽用?Java J4pExecResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


J4pExecResponse類屬於org.jolokia.client.request包,在下文中一共展示了J4pExecResponse類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCamelContextStatsAsXml

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public String getCamelContextStatsAsXml(String camelContextName, boolean fullStats, boolean includeProcessors) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        J4pExecResponse er = jolokia.execute(new J4pExecRequest(found, "dumpRoutesStatsAsXml(boolean,boolean)", fullStats, includeProcessors));
        if (er != null) {
            String xml = er.getValue();
            return xml;
        }
    }

    return null;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:18,代碼來源:DefaultJolokiaCamelController.java

示例2: getRouteModelAsXml

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public String getRouteModelAsXml(String routeId, String camelContextName) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        String pattern = String.format("%s:context=%s,type=routes,name=\"%s\"", found.getDomain(), found.getKeyProperty("context"), routeId);
        ObjectName on = ObjectName.getInstance(pattern);
        J4pExecResponse response = jolokia.execute(new J4pExecRequest(on, "dumpRouteAsXml()"));
        if (response != null) {
            String xml = response.getValue();
            return xml;
        }
    }

    return null;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:20,代碼來源:DefaultJolokiaCamelController.java

示例3: getRouteStatsAsXml

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public String getRouteStatsAsXml(String routeId, String camelContextName, boolean fullStats, boolean includeProcessors) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        String pattern = String.format("%s:context=%s,type=routes,name=\"%s\"", found.getDomain(), found.getKeyProperty("context"), routeId);
        ObjectName on = ObjectName.getInstance(pattern);
        J4pExecResponse response = jolokia.execute(new J4pExecRequest(on, "dumpRouteStatsAsXml(boolean,boolean)", fullStats, includeProcessors));
        if (response != null) {
            String xml = response.getValue();
            return xml;
        }
    }

    return null;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:20,代碼來源:DefaultJolokiaCamelController.java

示例4: getRestModelAsXml

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public String getRestModelAsXml(String camelContextName) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        J4pExecResponse response = jolokia.execute(new J4pExecRequest(found, "dumpRestsAsXml()"));
        if (response != null) {
            String xml = response.getValue();
            return xml;
        }
    }

    return null;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:18,代碼來源:DefaultJolokiaCamelController.java

示例5: getRestApiDocAsJson

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public String getRestApiDocAsJson(String camelContextName) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        String pattern = String.format("%s:context=%s,type=services,name=DefaultRestRegistry", found.getDomain(), found.getKeyProperty("context"));
        ObjectName on = ObjectName.getInstance(pattern);

        J4pExecResponse response = jolokia.execute(new J4pExecRequest(on, "apiDocAsJson()"));
        if (response != null) {
            String json = response.getValue();
            return json;
        }
    }

    return null;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:21,代碼來源:DefaultJolokiaCamelController.java

示例6: explainEndpointAsJSon

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public String explainEndpointAsJSon(String camelContextName, String uri, boolean allOptions) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        J4pExecResponse response = jolokia.execute(new J4pExecRequest(found, "explainEndpointJson(java.lang.String,boolean)", uri, allOptions));
        if (response != null) {
            String json = response.getValue();
            return json;
        }
    }

    return null;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:18,代碼來源:DefaultJolokiaCamelController.java

示例7: explainEipAsJSon

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public String explainEipAsJSon(String camelContextName, String nameOrId, boolean allOptions) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        J4pExecResponse response = jolokia.execute(new J4pExecRequest(found, "explainEipJson(java.lang.String,boolean)", nameOrId, allOptions));
        if (response != null) {
            String json = response.getValue();
            return json;
        }
    }

    return null;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:18,代碼來源:DefaultJolokiaCamelController.java

示例8: testExecData

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Test
public void testExecData() throws Exception {
	J4pClient j4pClient = new J4pClient("http://localhost:8080/jolokia-war-1.1.3");
	// J4pReadRequest req = new
	// J4pReadRequest("jboss.system:type=ServerInfo","ActiveThreadCount",
	// "ActiveThreadGroupCount", "MaxMemory", "HostName",
	// "TotalMemory","FreeMemory");
	List<String> attributes = Arrays.asList(new String[] { "DetailedStatus" });
	//
	// J4pReadRequest req = new
	// J4pReadRequest("jboss.ws:context=*,endpoint=*",
	// attributes.toArray(new String[]{}));

	J4pExecRequest req = new J4pExecRequest("se.arbetsformedlingen.utils.probe:service=TestWebService2", "checkStatus");

	J4pExecResponse resp = j4pClient.execute(req);
	Map<String, Object> v = (Map<String, Object>) resp.getValue();
	System.out.println(v);
	for (String attrib : attributes) {
		try {
			System.out.println(attrib + "=" + v.get(attrib));
		} catch (Exception ignore) {
		}
	}

}
 
開發者ID:cwikman,項目名稱:elasticsearch-river-jolokia,代碼行數:27,代碼來源:JolokiaTest.java

示例9: browseInflightExchanges

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public List<Map<String, Object>> browseInflightExchanges(String camelContextName, int limit, boolean sortByLongestDuration) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    List<Map<String, Object>> answer = new ArrayList<Map<String, Object>>();

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        String pattern = String.format("%s:context=%s,type=services,name=DefaultInflightRepository", found.getDomain(), found.getKeyProperty("context"));
        ObjectName on = ObjectName.getInstance(pattern);
        J4pExecResponse er = jolokia.execute(new J4pExecRequest(on, "browse(int,boolean)", limit, sortByLongestDuration));
        if (er != null) {
            JSONObject data = er.getValue();
            if (data != null) {
                for (Object obj : data.values()) {
                    JSONObject inflight = (JSONObject) obj;

                    Map<String, Object> row = new LinkedHashMap<String, Object>();
                    row.put("exchangeId", asString(inflight.get("exchangeId")));
                    row.put("fromRouteId", asString(inflight.get("fromRouteId")));
                    row.put("routeId", asString(inflight.get("routeId")));
                    row.put("nodeId", asString(inflight.get("nodeId")));
                    row.put("elapsed", asString(inflight.get("elapsed")));
                    row.put("duration", asString(inflight.get("duration")));
                    answer.add(row);
                }
            }
        }
    }

    return answer;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:35,代碼來源:DefaultJolokiaCamelController.java

示例10: executeOperation

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public Object executeOperation(ObjectName mbeanName, String operationName, Object[] params,
        Class<?>[] paramTypes) throws Exception {
    J4pExecRequest req = new J4pExecRequest(mbeanName, operationName, params);
    J4pExecResponse resp = this.getClient().execute(req);
    return resp.getValue();
}
 
開發者ID:hawkular,項目名稱:hawkular-agent,代碼行數:8,代碼來源:JolokiaJMXDriver.java

示例11: getEndpointRuntimeStatistics

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public List<Map<String, String>> getEndpointRuntimeStatistics(String camelContextName) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    List<Map<String, String>> answer = new ArrayList<Map<String, String>>();

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        String pattern = String.format("%s:context=%s,type=services,name=DefaultRuntimeEndpointRegistry", found.getDomain(), found.getKeyProperty("context"));
        ObjectName on = ObjectName.getInstance(pattern);

        J4pExecResponse response = jolokia.execute(new J4pExecRequest(on, "endpointStatistics()"));
        if (response != null) {
            JSONObject data = response.getValue();
            for (Object obj : data.values()) {
                JSONObject data2 = (JSONObject) obj;
                JSONObject service = (JSONObject) data2.values().iterator().next();

                Map<String, String> row = new LinkedHashMap<String, String>();
                row.put("index", asString(service.get("index")));
                row.put("url", asString(service.get("url")));
                row.put("routeId", asString(service.get("routeId")));
                row.put("direction", asString(service.get("direction")));
                row.put("static", asString(service.get("static")));
                row.put("dynamic", asString(service.get("dynamic")));
                row.put("hits", asString(service.get("hits")));
                answer.add(row);
            }
        }

        // sort the list
        Collections.sort(answer, new Comparator<Map<String, String>>() {
            @Override
            public int compare(Map<String, String> endpoint1, Map<String, String> endpoint2) {
                // sort by route id
                String route1 = endpoint1.get("routeId");
                String route2 = endpoint2.get("routeId");
                int num = route1.compareTo(route2);
                if (num == 0) {
                    // we want in before out
                    String dir1 = endpoint1.get("direction");
                    String dir2 = endpoint2.get("direction");
                    num = dir1.compareTo(dir2);
                }
                return num;
            }

        });
    }

    return answer;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:55,代碼來源:DefaultJolokiaCamelController.java

示例12: getRestServices

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public List<Map<String, String>> getRestServices(String camelContextName) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    List<Map<String, String>> answer = new ArrayList<Map<String, String>>();

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        String pattern = String.format("%s:context=%s,type=services,name=DefaultRestRegistry", found.getDomain(), found.getKeyProperty("context"));
        ObjectName on = ObjectName.getInstance(pattern);

        J4pExecResponse response = jolokia.execute(new J4pExecRequest(on, "listRestServices()"));
        if (response != null) {
            JSONObject data = response.getValue();
            if (data != null) {
                for (Object obj : data.values()) {
                    JSONObject data2 = (JSONObject) obj;
                    JSONObject service = (JSONObject) data2.values().iterator().next();

                    Map<String, String> row = new LinkedHashMap<String, String>();
                    row.put("basePath", asString(service.get("basePath")));
                    row.put("baseUrl", asString(service.get("baseUrl")));
                    row.put("consumes", asString(service.get("consumes")));
                    row.put("description", asString(service.get("description")));
                    row.put("inType", asString(service.get("inType")));
                    row.put("method", asString(service.get("method")));
                    row.put("outType", asString(service.get("outType")));
                    row.put("produces", asString(service.get("produces")));
                    row.put("routeId", asString(service.get("routeId")));
                    row.put("state", asString(service.get("state")));
                    row.put("uriTemplate", asString(service.get("uriTemplate")));
                    row.put("url", asString(service.get("url")));
                    answer.add(row);
                }
            }
        }

        // sort the list
        Collections.sort(answer, new Comparator<Map<String, String>>() {
            @Override
            public int compare(Map<String, String> service1, Map<String, String> service2) {
                String url1 = service1.get("url");
                String url2 = service2.get("url");
                return url1.compareTo(url2);
            }
        });
    }

    return answer;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:53,代碼來源:DefaultJolokiaCamelController.java

示例13: listComponents

import org.jolokia.client.request.J4pExecResponse; //導入依賴的package包/類
@Override
public List<Map<String, String>> listComponents(String camelContextName) throws Exception {
    if (jolokia == null) {
        throw new IllegalStateException("Need to connect to remote jolokia first");
    }

    List<Map<String, String>> answer = new ArrayList<Map<String, String>>();

    ObjectName found = lookupCamelContext(camelContextName);
    if (found != null) {
        J4pExecResponse response = jolokia.execute(new J4pExecRequest(found, "listComponents()"));
        if (response != null) {
            JSONObject data = response.getValue();
            for (Object obj : data.values()) {
                JSONObject component = (JSONObject) obj;

                Map<String, String> row = new LinkedHashMap<String, String>();
                row.put("artifactId", asString(component.get("artifactId")));
                row.put("title", asString(component.get("title")));
                row.put("description", asString(component.get("description")));
                row.put("groupId", asString(component.get("groupId")));
                row.put("label", asString(component.get("label")));
                row.put("name", asString(component.get("name")));
                row.put("status", asString(component.get("status")));
                row.put("type", asString(component.get("type")));
                row.put("version", asString(component.get("version")));
                answer.add(row);
            }
        }

        // sort the list
        Collections.sort(answer, new Comparator<Map<String, String>>() {
            @Override
            public int compare(Map<String, String> component1, Map<String, String> component2) {
                String name1 = component1.get("name");
                String name2 = component2.get("name");
                return name1.compareTo(name2);
            }
        });
    }

    return answer;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:44,代碼來源:DefaultJolokiaCamelController.java


注:本文中的org.jolokia.client.request.J4pExecResponse類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。