List of usage examples for javax.management MBeanOperationInfo getDescription
public String getDescription()
From source file:flens.query.JMXQuery.java
private Map<String, Object> getOpperations(MBeanInfo info) { Map<String, Object> outc = new HashMap<>(); MBeanOperationInfo[] atts = info.getOperations(); for (MBeanOperationInfo att : atts) { Map<String, Object> out = new HashMap<>(); outc.put(att.getName(), out);/*from w w w .j a v a 2 s . c o m*/ out.put("description", att.getDescription()); out.put("return-type", att.getReturnType()); out.put("signature", getSig(att.getSignature())); } return outc; }
From source file:org.sakaiproject.status.StatusServlet.java
protected void reportDetailedWebappStatus(HttpServletResponse response) throws Exception { PrintWriter pw = response.getWriter(); for (ObjectName appName : findMBeans("*:j2eeType=WebModule,*")) { for (MBeanAttributeInfo mbai : mbs.getMBeanInfo(appName).getAttributes()) { pw.print(mbai.getName() + ","); pw.print(mbai.getType() + ","); pw.print(mbai.getDescription() + ","); pw.print(mbs.getAttribute(appName, mbai.getName()) + "\n"); }//from w ww . j a v a 2s . c om pw.print("\n"); for (MBeanOperationInfo mboi : mbs.getMBeanInfo(appName).getOperations()) { pw.print(mboi.getName() + ","); pw.print(mboi.getReturnType() + ","); pw.print(mboi.getDescription() + "\n"); } pw.print("\n\n"); } }
From source file:org.jolokia.handler.list.OperationDataUpdater.java
/** {@inheritDoc} */ @Override//w ww . j a va 2s .c om protected JSONObject extractData(MBeanInfo pMBeanInfo, String pOperation) { JSONObject opMap = new JSONObject(); for (MBeanOperationInfo opInfo : pMBeanInfo.getOperations()) { if (pOperation == null || opInfo.getName().equals(pOperation)) { JSONObject map = new JSONObject(); JSONArray argList = new JSONArray(); for (MBeanParameterInfo paramInfo : opInfo.getSignature()) { JSONObject args = new JSONObject(); args.put(DESCRIPTION.getKey(), paramInfo.getDescription()); args.put(NAME.getKey(), paramInfo.getName()); args.put(TYPE.getKey(), paramInfo.getType()); argList.add(args); } map.put(ARGS.getKey(), argList); map.put(RETURN_TYPE.getKey(), opInfo.getReturnType()); map.put(DESCRIPTION.getKey(), opInfo.getDescription()); Object ops = opMap.get(opInfo.getName()); if (ops != null) { if (ops instanceof List) { // If it is already a list, simply add it to the end ((List) ops).add(map); } else if (ops instanceof Map) { // If it is a map, add a list with two elements // (the old one and the new one) JSONArray opList = new JSONArray(); opList.add(ops); opList.add(map); opMap.put(opInfo.getName(), opList); } else { throw new IllegalArgumentException( "Internal: list, addOperations: Expected Map or List, not " + ops.getClass()); } } else { // No value set yet, simply add the map as plain value opMap.put(opInfo.getName(), map); } } } return opMap; }
From source file:org.sakaiproject.status.StatusServlet.java
protected void reportAllMBeanDetails(HttpServletResponse response) throws Exception { PrintWriter pw = response.getWriter(); Set<ObjectInstance> allBeans = mbs.queryMBeans(null, null); SortedSet sortedBeanNames = new TreeSet(); for (ObjectInstance bean : allBeans) { sortedBeanNames.add(bean.getObjectName().toString()); }/*ww w .j a v a2 s. c om*/ for (Object beanName : sortedBeanNames) { pw.print(beanName.toString() + "\n"); ObjectName beanObjectName = new ObjectName(beanName.toString()); for (MBeanAttributeInfo mbai : mbs.getMBeanInfo(beanObjectName).getAttributes()) { pw.print(" "); pw.print(mbai.getName() + ","); pw.print(mbai.getType() + ","); pw.print(mbai.getDescription() + ","); pw.print(mbs.getAttribute(beanObjectName, mbai.getName()) + "\n"); } pw.print("\n"); for (MBeanOperationInfo mboi : mbs.getMBeanInfo(beanObjectName).getOperations()) { pw.print(" "); pw.print(mboi.getReturnType() + ","); pw.print(mboi.getName() + "("); for (MBeanParameterInfo mbpi : mboi.getSignature()) { pw.print(mbpi.getType() + " " + mbpi.getName() + ","); } pw.print("),"); pw.print(mboi.getDescription() + "\n"); } pw.print("\n-----------------------------\n\n"); } }