![]() |
JMX Reference Implementation) Tutorial |
![]() Standard and Dynamic MBeans |
![]() Contents |
![]() Conclusion |
Since an agent can manage hundreds of MBeans, the agent view provides a filtering mechanism for the list that is displayed. The object name is used as the filter, and only those MBeans which match are counted and displayed.Action: Go to the administration page, and create three more of each of the standard and dynamic MBeans. Modify only the "number" property in their object name so that they are numbered sequentially. Also create any MBean in the default domain (you may have to reload the administration page to get its name). Then go back to the agent view, which should display all of the new MBeans.
Filters are entered as partial object names with wild-card characters or as a full object name for which to search. Here are the basic substition rules for filtering:
Note that by filtering rules 2 and 4, question marks may not appear in the keys.
- The asterisk (
*
) stands for any number (including zero) of any characters
OR for any number of any keys (complete property-value pairs)- The question mark (
?
) stands for any one character- An empty domain name stands for the default domain string; an empty key list is illegal
- You may search for partial domain names, but keys are atomic (you may not search for a partial key property or a partial key value)
- You must match all keys exactly: use the form property
=
value,*
to search for one key in names with multiple keys- Keys are unordered when filtering: giving one or more keys (and an asterisk) finds all object names which contain that subset of keys
Action: Enter the following filter strings to see the resulting MBean list:
*_MBeans:* |
allowed |
:* |
allowed |
*:name=Simple*,* |
not allowed by rule 4 |
*:name=Simple |
allowed, but list is empty (rule 5) |
*:name=html,* |
allowed |
DefaultDomain: |
not allowed by rule 3 |
Adaptor:* |
allowed |
*:port=80??,* |
not allowed by rule 4 |
*_??????:number=2,* |
allowed |
(empty string) |
allowed: special case
equivalent to *:* |
Notice how the MBean count is updated with each filter: this count gives the number of MBeans that were found with the current filter, which is the number of MBeans appearing on the page. It is not the total number of MBeans in the agent, unless the filter is
*:*
.Filters are perhaps less useful when managing a small agent through the HTML adaptor. However, MBeans can use the same filter mechanism to get lists of other MBeans when interacting programatically with the MBean server in an agent.
![]() Standard and Dynamic MBeans |
![]() Contents |
![]() Conclusion |
Copyright © 2000
Sun Microsystems, Inc.,
901 San Antonio Road, Palo Alto, CA 94303, USA.
All rights reserved.