There are five types of MBeans: Standard, Dynamic, Model, Open, and Monitor.We??™ll just use Standard
MBeans in this chapter, because they??™re the simplest. The largest distinguishing factor between the different
types is the level of control you have over descriptions of the services in the bean. For Standard beans, all
this information is gathered at runtime by the use of introspection of interfaces, while the other bean types
can explicitly describe themselves.
You need to register MBeans with an MBeanServer. You can do this in several different ways, either by
doing it programmatically or by providing a so-called M-Let, which is an XML description of an MBean to be
deployed. Once deployed in an MBeanServer, MBeans can be reached by MBean clients. There are two types
of clients: generic or specific. The specific clients work explicitly with the operations they know the server
provides, while generic clients can discover things at runtime, and let you decide how to invoke operations.
JConsole is a good example of both specific and generic operations. The specific parts of it are what
allow you to see the memory and thread usage of a Java application. Because that information is provided by
specific MBeans in Java, and JConsole knows how to use them, it can provide nice graphs of this information.
On the other hand, you can also look at attributes and invoke operations on user-defined MBeans in
JConsole, which is the generic part.
The EJB Client Revisited
First of all, let??™s take a closer look at the EJB client you created in the last chapter.
Pages:
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279