SylvainJuge / polarrose-jmx-rest-bridge

Automatically exported from code.google.com/p/polarrose-jmx-rest-bridge
0 stars 0 forks source link

Multiple Objects and Attributes with one Request not possible #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I would like to get multiple values with one requests, but it was not possible.

Changed it to the following request:
http://host:port/jmxbridge/retrieveAttribute?service=service:jmx:jmxmp://host2:p
ort2&object1=java.lang:type=Memory&attribute1=HeapMemoryUsage&attribute1=NonHeap
MemoryUsage&object2=j  ava.lang:type=ClassLoading&attribute2=LoadedClassCount

I have changed the code to request multiple values. Could you please contact me 
because I can not contact you.

Thanks, seb

Original issue reported on code.google.com by sebastia...@gmail.com on 23 Mar 2011 at 8:40

GoogleCodeExporter commented 8 years ago
Changed it to the following request:
http://host:port/jmxbridge/retrieveAttribute?service=service:jmx:jmxmp://host2:p
ort2& nums=2 & 
object1=java.lang:type=Memory&attribute1=HeapMemoryUsage&attribute1=NonHeapMemor
yUsage&object2=j  ava.lang:type=ClassLoading&attribute2=LoadedClassCount

chg src:
  response.setContentType("text/plain");

Object value = null;
        nums=request.getParameter("nums");
        for (int i = 1; i <= nums; i++) {
            try {
                value = retrieveAttribute(
                    request.getParameter("service"),
                    request.getParameter("object"+i),
                    request.getParameter("attribute"+i)
     response.getWriter().println(value);
                );
            } catch (Exception e) {

            }
        }

Original comment by yippees...@gmail.com on 2 Sep 2011 at 8:16