What is Mbeanserver

Source: Internet
Author: User

What is Mbeanserver

Mbeanserver is a repository that contains all the registered Mbean. It is the core of the JMX agent layer. The JMX1.0 specification provides an interface called Javax.management.MBeanServer. All managed in Mbean operations are performed via Mbeanserver. With Mbeanserver instances, you can manage all mbean. Each mbean has a unique flag called objectname.

What is objectname

ObjectName (Javax.management.ObjectName) is a class that The only sign of an mbean in Mbeanserver. This object name is used to manage the application to flag the Mbean so that the operation can be invoked on the appropriate Mbean. An object name contains two parts. They are

    1. A domain name

    2. One or more key attribute sets that are not sorted

A domain name is a case-sensitive string that can include anything except [:, = *?] Other than the character.

The Domain name section can be ignored in an object name, and if so, Mbeanserver can provide a default domain name. The default domain name will be defaultdomain.

The key attribute set organizes the second part of the object name. A key attribute is a name-value pair, and the name does not need to correspond to any of the properties or operations of the Mbean. The key attribute set must contain at least one key attribute. It can contain any number of key attributes, and the order of these key attributes is meaningless.

For example, if we describe a dolphin as an mbean, then a set of object names can be

Animals:name=dolphin,kind=fish

In this object name, the string animals consists of a domain name, and the key attribute set is described by two key attributes: Name and type, with values of dolphin and fish respectively.

The generic object name description is described as the following syntax:

[Domain name]:p Roperty=value[,property=value]

If the domain name is omitted, Mbeanserver will provide a default domain name called [DefaultDomain]. At least one key attribute must be included. Any number of key attributes can be added.

Create a Mbeanserver instance

Mbeanserver instances can be obtained using the methods provided by the Mbeanserverfactory class. The Mbeanserverfactory class provides the following methods to obtain the Mbeanserver instance:

public static Mbeanserver Creatembeanserver ()

public static Mbeanserver Creatembeanserver (String domain)

public static Mbeanserver Newmbeanserver ()

public static Mbeanserver Newmbeanserver (String domain)

In the method declared above, the string domain describes the object name The domain part of the. Creatembeanserver method and the Newmbeanserver method return a Mbeanserver instance. The difference between the two methods is that Creatembeanserver returns a Mbeanserver instance and saves the instance's association so that it can be used with the fi The Ndmbeanserver method accesses this instance. The Newmbeanserver method will not save any association for the instance of this created mbeanserver.

If you create a Mbeanserver instance using the constructor of a variable, the string variable will be the domain name of the Mbeanserver instance that was created. If a constructor without a variable is used to create a mbeanserver instance, Then the domain name will be defaultdomain with the string.

Find an Mbeanserver instance

The Mbeanserverfactory class provides a method called Findmbeanserver for a specified mbeanserver instance, or for all mbeanserver instances to be fetched. The declaration of this method is

public static ArrayList Findmbeanserver (string id) Here the string ID indicates the mbeanserver identifier. If this string is null, all mbeanserver registered in this JVM are returned. If you want to return the corresponding specified Mbeanserver instance, you must provide the corresponding string ID for the Mbeanserver instance. This string ID can be obtained by Mbeanserverdelegatembean's Stringid property.

Mbeanserverdelegate Mbean regardless of when a mbeanserver is initialized, the Mbeanserverdelegate class is registered as an Mbean,

The name is jmimplementation:type=mbeanserverdelegate. This mbean provides information about this Mbean server.

The Mbeanserverdelegate MBean has seven read-only properties, named Mbeanserverid, Specificationname, Specificationversion, Specificationvendor, Implementationname, Implementationversion and Implementationvendor.

The default value for the properties provided by the Mbeanserverdelegate MBean for Xmojo Project 5 is:

Property name Property value
Specificationversion 1.0, Final Release
Specificationvendor Sun Microsystems INC.
Implementationversion 5
Implementationvendor Xmojo (sponsered by Adventnet Inc.)
Implementationname The Xmojo Project
Mbeanserverid _1
Specificationname Java Management Extensions Instrumentation and Agent specification

The Mbeanserverdelegate Mbean responds to broadcast messages sent by Mbeanserver. Whenever an Mbean is registered or unregistered,

Mbeanserverdelegate MBean broadcast types are jmx.mbean.created and jmx.mbean.deleted messages to all registered listeners.

Some points to keep in mind

    1. Mbeanserver maintains a registered Mbean. Each mbean is distinguished by a uniquely named pattern called the object name.

    2. Mbeanserver instances can be obtained using static methods of the Mbeanserverfactory class.

    3. The Mbeanserverdelegate MBean is a description of the Mbeanserver and is also the broadcaster MBEANSERVER the message.

What is Mbeanserver

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.