Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Java Management Extensions
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Managed beans == A '''managed bean''' β sometimes simply referred to as an ''MBean'' β is a type of [[JavaBean]], created with [[dependency injection]]. Managed Beans are particularly used in the Java Management Extensions technology β but with Java EE 6 the specification provides for a more detailed meaning of a managed bean. The MBean represents a resource running in the [[Java virtual machine]], such as an application or a Java EE technical service (transactional monitor, JDBC driver, etc.). They can be used for collecting statistics on concerns like performance, resources usage, or problems (pull); for getting and setting application configurations or properties (push/pull); and notifying events like faults or state changes (push). Java EE 6 provides that a managed bean is a bean that is implemented by a Java class, which is called its bean class. A top-level Java class is a managed bean if it is defined to be a managed bean by any other Java EE technology specification (for example, the [[JavaServer Faces]] technology specification), or if it meets all of the following conditions: # It is not a non-static inner class. # It is a concrete class, or is annotated <code>@Decorator</code>. # It is not annotated with an EJB component-defining annotation or declared as an EJB bean class in <code>ejb-jar.xml</code>. No special declaration, such as an annotation, is required to define a managed bean. A MBean can notify the MBeanServer of its internal changes (for the attributes) by implementing the <code>javax.management.NotificationEmitter</code>. The application interested in the MBean's changes registers a listener (<code>javax.management.NotificationListener</code>) to the MBeanServer. Note that JMX does not guarantee that the listeners will receive all notifications.<ref>[http://www.oracle.com/technetwork/java/javase/tech/best-practices-jsp-136021.html Java Management Extensions (JMX) β Best Practices]</ref> ===Types=== There are two basic types of MBean: * ''Standard MBeans'' implement a business interface containing setters and getters for the attributes and the operations (i.e., methods). * ''Dynamic MBeans'' implement the <code>javax.management.DynamicMBean</code> interface that provides a way to list the attributes and operations, and to get and set the attribute values. Additional types are ''Open MBeans'', ''Model MBeans'' and ''Monitor MBeans''. ''Open MBeans'' are dynamic MBeans that rely on the basic data types. They are self-explanatory and more user-friendly. ''Model MBeans'' are dynamic MBeans that can be configured during runtime. A generic MBean class is also provided for dynamically configuring the resources during program runtime. A MXBean (''Platform MBean'') is a special type of MBean that [[Reification (computer science)|reifies]] [[Java virtual machine]] subsystems such as [[garbage collection (computer science)|garbage collection]], [[JIT compilation]], [[memory pools]], [[Thread (computer science)|multi-threading]], etc. A MLet (''Management applet'') is a utility MBean to load, instantiate and register MBeans in a MBeanServer from an [[XML]] description. The format of the XML descriptor is:<ref> {{cite news | url= http://java.sun.com/j2se/1.5.0/docs/api/javax/management/loading/MLet.html | title= MLet (Java 2 Platform SE 5.0) | publisher= [[Sun Microsystems]] | access-date= 2008-06-22 }} </ref> <pre> <MLET CODE = ''class'' | OBJECT = ''serfile'' ARCHIVE = ''archiveList'' [CODEBASE = ''codebaseURL''] [NAME = ''objectName''] [VERSION = ''version''] > [arglist] </MLET> </pre>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)