-
1. Re: How do I remotely access an mbean attribute value?
genman Oct 2, 2007 1:52 AM (in response to rcolaco)Query the MBean and get back the list of all attributes. Probably you need to use "RequestProcessingTime" (big "R") instead.
-
2. Re: How do I remotely access an mbean attribute value?
rcolaco Oct 2, 2007 10:36 AM (in response to rcolaco)Tried that already; didn't work.
Tried several variations...
a] accessing via attribute: requestProcessingTime
b] accessing via attribute: RequestProcessingTime
c] accessing as operation: getRequestProcessingTime
None of these worked.
- Rohit -
3. Re: How do I remotely access an mbean attribute value?
dimitris Oct 2, 2007 10:48 AM (in response to rcolaco)For the mbean you are interested in, check out the exported attributes operations, e.g.:
cd jboss-x.y.z\bin twiddle info "jboss.web:type=GlobalRequestProcessor,name=http-127.0.0.1-8080" Description: null +++ Attributes: Name: modelerType Type: java.lang.String Access: r- Name: errorCount Type: int Access: rw Name: bytesReceived Type: long Access: rw Name: bytesSent Type: long Access: rw Name: processingTime Type: long Access: rw Name: requestCount Type: int Access: rw Name: maxTime Type: long Access: rw +++ Operations: void resetCounters()
-
4. Re: How do I remotely access an mbean attribute value?
rcolaco Oct 5, 2007 5:43 PM (in response to rcolaco)As confirmed, I am already aware of the attributes available for this mbean. This can be retrieved using ...
MBeanInfo mbi = connection.getMBeanInfo(name); MBeanAttributeInfo[] mbaia = mbi.getAttributes();
Anyways, I invoked a twiddle info on this mbean and here's the output:[root@machine bin]# ./twiddle.sh info "jboss.web:name=HttpRequest0,type=RequestP rocessor,worker=http-0.0.0.0-8080" Description: null +++ Attributes: Name: modelerType Type: java.lang.String Access: rw Name: virtualHost Type: java.lang.String Access: r- Name: bytesSent Type: long Access: rw Name: method Type: java.lang.String Access: r- Name: remoteAddr Type: java.lang.String Access: r- Name: requestBytesSent Type: long Access: r- Name: contentLength Type: int Access: r- Name: bytesReceived Type: long Access: rw Name: requestProcessingTime Type: long Access: r- Name: globalProcessor Type: org.apache.coyote.RequestGroupInfo Access: rw Name: protocol Type: java.lang.String Access: r- Name: currentQueryString Type: java.lang.String Access: r- Name: maxRequestUri Type: java.lang.String Access: rw Name: requestBytesReceived Type: long Access: r- Name: serverPort Type: int Access: r- Name: stage Type: int Access: rw Name: requestCount Type: int Access: rw Name: maxTime Type: long Access: rw Name: processingTime Type: long Access: rw Name: currentUri Type: java.lang.String Access: r- Name: errorCount Type: int Access: rw +++ Operations:
I still have a problem retrieving the VALUE of the mbean attribute using Java code as initially posted. Any suggestions on how this can be retrieved? i.e. specifically for the requestProcessingTime attribute.
Thanks
- Rohit -
5. Re: How do I remotely access an mbean attribute value?
dimitris Oct 8, 2007 4:44 AM (in response to rcolaco)I just tried this very simple twiddle command on 4.0.5 and got:
X:\jboss\jboss-4.0.5.GA\bin>twiddle get "jboss.web:type=RequestProcessor,worker= http-0.0.0.0-8080,name=HttpRequest0" requestProcessingTime remoteAddr maxRequestUri requestProcessingTime=1191832947562 remoteAddr=null maxRequestUri=null
-
6. Re: How do I remotely access an mbean attribute value?
rcolaco Oct 8, 2007 8:41 AM (in response to rcolaco)So if twiddle gets the requestProcessingTime, how do I get it from the Java code snippet that I posted? If my Java code is incorrect, could you suggest a piece of code that could retrieve this?
Thanks
- Rohit -
7. Re: How do I remotely access an mbean attribute value?
dimitris Oct 9, 2007 5:55 AM (in response to rcolaco)There is nothing special with the code to read the mbean attribute. The code you showed should work. Maybe you don't get to the right mbean or mbean server?
Whatever results you get, make sure it's the same with what you would see with jmx-console. Try to hit the attributes of another mbean, e.g. jboss.system:type=ServerInfo