This simple Mbean has only one attribute and one method, Stardbeandemomain for the calling class, and the following three methods are called in the Main method, with detailed comments in the code: Sbean.doregistbean (); Sbean.domanagebean (); Sbean.reghtmladaptor ();
After running, you can see the information that the console prints, register Standmbean sucess. Attribute:state-init valueattribute:state 2-new statemy service start ....
Because the Htmladaptor service is started, the program is always running, and (Htmladaptor is one of the adapters that Sun JMX implements) the test can be accessed in the browser: http://localhost:8082 You can manage the MBean in the browser, and by pressing the StartService button under the list of MBean operations, you can see the information that the console is playing, indicating that the StartService method was invoked.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.