Java Reference
In-Depth Information
unchanging MBean interfaces that an application uses to access certain imple-
mentations of functionality it needs. With the MBean interfaces staying the same
over time, you can change the MBean implementation as needed, preserving
access to the functionality. The next example demonstrates this concept.
Abstracting a data layer
We already showed how an application can encapsulate the creation of data-
base connections. Taking that concept a little further, an application can
abstract its entire data access layer by using JMX . Figure 4.8 illustrates the data
abstraction concept.
This example is presented as a Standard MBean because it would be devel-
oped with a well-known interface. It would be developed along with the applica-
tion, and its interface could be defined in advance. For this scenario to work, the
application needs to send and receive data to the data layer in a form indepen-
dent of the persistence mechanism. The interface to the data layer is dependent
on the application, so a full code example is not too useful. However, you could
expect the interface to resemble something like the following:
Figure 4.8
Abstracting a data layer using
JMX. A Standard MBean
shields the application from
the actual implementation of
the data layer.
Search WWH ::




Custom Search