Java Reference
In-Depth Information
In the previous chapter, you learned about using
JMX
with the Java Message Ser-
vice (
JMS
), one of the components of the
J2EE
platform. In this chapter, you will
learn about using
JMX
with Enterprise JavaBeans (
EJB
), a technology that enables
you to access and manipulate enterprise data.
When people speak of
J2EE
, Enterprise JavaBeans immediately come to mind,
because
EJB
s are the most robust, scalable way to create enterprise applications.
However, like other applications,
EJB
applications can suffer from a lack of man-
agement and inability to be configured at runtime. Without additional custom
development,
EJB
applications often cannot easily provide a high level of obser-
vation and modification at runtime.
By combining
JMX
with your
EJB
s, you can provide a distributed, simple way to
gather information about, alter the behavior of, and monitor your enterprise appli-
cations. Using
JMX
, you can easily tap into the functionality of an
EJB
; in return for
a little additional work, you gain significant advantages. As in chapter 13, which
demonstrated this same advantage by using
JMX
with
JMS
, you can use
JMX
to
open a window into the enterprise application.
Note that this chapter won't help you understand
EJB
s completely if you don't
http://www.javasoft.com.
14.1 An EJB review
As we just stated, this chapter isn't an
EJB
tutorial. However, before diving into
working with
EJB
s and
JMX
, we do need to review a little information about
EJB
s.
mentation at http://www.javasoft.com.
14.1.1
The EJB model
As we've mentioned,
EJB
s are an ideal way for applications to access enterprise
data. The
EJB
specification defines a pattern for creating
EJB
s such that they can
be deployed in different containers without any code modification. The
EJB
con-
tainer provides services such as database persistence and an execution
JVM
. To
contain the
EJB
s in this chapter, you will again be using JBoss.
The
EJB
specification currently defines three types of
EJB
s: session beans,
entity beans, and message-driven beans. Each type of
EJB
gives you different
capabilities for reading or manipulating data.