Adding JMX Manageability to the Shopping Cart
You can manage the Shopping Cart from two perspectives.
- Customer
- Shop keeper
A customer would be interested in adding items to his cart, updating the items,
removing the items from the cart. A customer would also like to know
the total items purchased and the total price of the purchased items.
A shop keeper would be interested in managing the inventory level of the
items. If the inventory level of a item decreases, the shop keeper
would like to add some more items of that category.
To provide JMX manageability to the Shopping Cart application, you need to
define two MBeans. One MBean for customer perspective management and the
other MBean for shop keeper perspective management.
Both these MBeans should be capable of communicating with the shopping cart
application and getting the required information.
In this tutorial, you will see how the ShoppingCart application can be managed
from both the perspectives. For this, you will go through the following
steps:
- Creating an MBean which contains details required by a customer --
CartMBean
- Creating an MBean which contains details required by a shop keeper
-- InventoryMBean
- Creating a JMX agent
- Running and Testing the agent