aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes This weeks giveaway Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "This weeks giveaway "JMX in Action"" Watch "This weeks giveaway "JMX in Action"" New topic
Author

This weeks giveaway "JMX in Action"

Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
This weeks give away is "JMX in Action"
The best part, the Authors Benjamin G. Sullins and Mark Whipple are online to answer your questions.
Thanks to the good people at Manning Publishing for the books.
Rules for the Giveaway can be found at Book Promotion Page
Good Luck and have fun
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
Hi guys,
A warm welcome to JavaRanch - it's great to have you here and I hope you have a week!
JMX is an area that many people may not be completely aware of, and particularly how it fits into J2EE. Do you want to give everybody a quick summary and tell us where your book fits in?
Cheers
Simon
[ October 08, 2002: Message edited by: Simon Brown ]
Mandan Happy
Ranch Hand

Joined: Dec 17, 2001
Posts: 65
Hi,
Could you begin by describing the life cycle of an MBean and how it interferes with the Life Cycle of an EJB if I were to have an MBean exposing the performance statistic of an EJB .
If you can give the pros and cons of using JMX when compared to using SNMP,WBEM,CMIP that will be great !!
Thx
Mandan
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
Hello everyone. Thanks for coming to discuss the book. To summarize it:
JMX in action covers all things JMX. It details its architecture and its uses. It shows you the purposes and how to build the 4 MBean types (standard, dynamic, model, and open). Although it has only an appendix for open MBeans. In addtions, it covers the JMX notification model, and the four agent services: relation service, timer and monitor services, query service, and mlet service. Each of which adds significant features to a JMX agent. We also wrote a chapter showing you how to build your own protocol adapters for JMX agents (these allow you to use a variety of clients to reach your MBeans ). Finally, we conclude the book by using JMX with EJB and JMS.
Now that I have used enough JMX jargon, please feel free to ask me what any of that meant!
Ben


author of <a href="http://www.amazon.com/exec/obidos/tg/detail/-/1930110561/qid=1034088673/sr=8-1/ref=sr_8_1/104-4581256-8004760?v=glance&n=507846" target="_blank" rel="nofollow">JMX in Action</a>
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
JMX fits into a J2EE app by letting you to a couple of things. First, you can expose attributes of your J2EE components to a variety of management clients such as a browser, SNMP, TCP, or whatever. You can set/get attributes and invoke methods.
Second, You can use the JMX architecture to your advantage to build componentized software. JBoss has been constructed this way. Since MBeans are used to implement features of their server, they can be swapped out to replace implementation.
Ben
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
MBeans can be used to expose EJB attributes (in fact we do this in the book). There are 2 ways you can do this:
First, you can have register an MBean in a JMX agent which then looks up an EJB. This is good if you simply want to expose business logic to a management console.
Second, you can have the EJB create the MBean. This method allows the EJB to handle the registration and removal of the MBean upon the same events in the EJB lifecyle. When the MBean is registered on the JMX agent, you can interact with the EJB. As the EJB is remove during the course of its life, it also removes the MBean.

whew, trying to keep up....
Ben
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
Hi Ben,
Just a quick request, but could you just take a quick look at the naming policy and edit your profile accordingly. It will also help people to better identify you in the giveaway.
Thanks!
Simon
Bartender (moderator) of "J2EE and EJB" forum
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
Done!
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
Thanks!
Daniel Ng
Greenhorn

Joined: Jul 09, 2002
Posts: 27
I checked out amazon, and the book does not seem to come with a CD. Is there a reference in you book telling people where to download your sample code, so we can try them out?
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
Yes, the code can be downloaded from the publisher's website for free. Check it out at http://www.manning.com/sullins . You can also purchase the book there.
thanks.
[ October 08, 2002: Message edited by: Ben Sullins ]
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
As mentioned before, there are four types of MBeans, here is a description of the most common types:
1. Standard MBeans. These MBeans have a static management interface defined by a Java interface. That is, you predefine each of the exposed attributes with getters and setters and provide other methods as needed. The management interface cannot change during runtime.
2. Dynamic MBeans implement the javax.management.DynamicMBean interface, which provides methods for setting and getting meta data from the MBean which describes its management interface. The exposed attributes and operations are provided at runtime to those that ask it.
3. Model MBeans are fantastic. They can provide smart management. They have a managed object set in them a runtime, and describe the exposed attributes and operations at runtime. In addition, they have configurable management conditions for things like caching return values, attribute values, logging, and more.
In addition, any MBean can be a notification broadcaster. Notifications can be used to signal attribute changes, timers, etc.
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
additionally, there are sample chapters available at Manning's site.
David Li
Ranch Hand

Joined: Aug 12, 2002
Posts: 41
Excuse me, I don't know little about "MBean".
Is it a Message Driven Bean?
Thanks.


David,<br />SCJP - 94% (2002-7-6)
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Where exactly can I use JMX?Could you please elaborate?
Thanks,
VEdhas.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
MBeans are the basic resources of JMX. MBean stands for Managed Bean.
[ October 08, 2002: Message edited by: Chris Mathews ]
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
ok, lets back up a bit. JMX stands for Java Management Extensions. The JMX architecture is constructed by JMX agents (which contain one main object, an MBeanServer instance). Agents contain one or MBeans that manage components or logic from applications or hardware. MBeans can be reached through code, or through the use of any client. JMX agents use protocol adaptors (also MBeans) that allow management clients to reach MBeans. For instance, in our book, we use an RMI adaptor, Jini adaptor (makes MBean a Jini service), and TCP adaptor. Other adaptors could be used for SOAP, etc.
MBeans are like JavaBeans, in that they expose attributes and operations based upon naming conventions. In a previous post, I described 3 of the types of MBeans.
JMX agents (or the MBeanServer) can be a stand alone application or embedded within an application. Many of today's application servers include an MBeanServer (like JBoss, and BEA). MBeans can then be used to expose portions of an application for management. You can set/get attributes, invoke operations, or setup monitors to detect and recover from failures. All of this is done at runtime. There are also notification systems, MBean relationsips, timers and monitors, a dynamic loading service (load MBeans from remote locations during runtime from an XML-like file), and an MBean query service.
Venkatesh Panudrangaiah
Greenhorn

Joined: Feb 05, 2002
Posts: 1
Hi
What is the purpose of using MBean in j2ee??
Bye
Venkatesh
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
The purpose of JMX in J2ee is to provide managment and monitoring for J2EE applications. We use example of exposing EJBs and JMS messages directly to managment consoles. In addition, JSR 77 is attempting to define management strategies for the J2EE enviroment. This a new topic, but will be an important one in the future as it will increase the flexibity (through configuration) and reliability (through monitoring) of enterprise applications.
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
One day left, any more JMX questions out there?
Mandan Happy
Ranch Hand

Joined: Dec 17, 2001
Posts: 65
Sure a lot of them...
some are related to books and some general stuff..
(1) There are a few books on jmx and they typically start explaining whatz an MBean and then move on to Agent and then describe a couple of Adaptors. howz this book different ?
(2) Any real life scenario explained ?
Say Managing a distributed Java system with multiple JMX agents with master-sub agent architecture..
if not can you include these features too in the next edition...
(3) I have read a couple of books and they seem to describe just the JMX api...but Ideally I would like to read one that gives a firm foundation...starting with SNMP,WBEM,CMIP,DMI and then moving on to JMX ...and then describing an SNMP Adaptor,WBEM adaptor......Master-Sub agent Architecture....JMX Agent deployment....
( perhaps I have an expectation creep :-) )
use case one :
I need some performance statistics from Oracle...I can use SNMP to get them....why would I go for JMX...or is JMX suited for that....
use case 2 :
I need some OS info from Solaris,Linux,NT....
do I use WBEM or SNMP or JMX+JNI for that....
use case 3 :
I want to expose business logic to a management console..Most management consoles prefers SNMP ..Y should I go for JMX
(4) Does JMX enables Service Level Management of a
a distributed J2ee application infrastructure ?
(5) any prodcuts on JMX explained such as AdventNets Manage Engine, Suns JAMIE ?
(6)
Is JMX Yet Another API ? Is there a real need for JMX.....does one need a lot of Bean types ..and add more Jargons to an already congested technical vocabulary ?
(7)Big Question :
Is JMX borrowed from Corba Services...Query Service,Timers,relations all seems to be borrowed from CORBA services .
(8)
MBean as jini service..is that what sun calls as Spontaneous Management ?
(9 ) Anybody here from OASIS ..whats happening to web services management protocol..can I use JMX to manage webs services.. ?
(10) Is JMX limited to AppServer management and J2ee application management ?
ThanX
-Mandan
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
Thanks for questions!
All very good questions, glad you got through them all. I will answer them as the day continues (as I am at work right now ). First answers coming shortly.
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
answering questions in no particular order:
(10) Can JMX be used for other thing than app server or J2ee app management?
Yes, you can use it for every type of software and hardware runtime management and configuration. JMX can also be used as a componentized architecture in the way JBoss does. For instance, i first became involved with JMX while writing a standalone monitoring app. We created an Jini server, that discovered JMX agents hosted on machines with other proprietary software. Each JMX agent contained MBeans that were used to monitor the activity of the software. In addtion, we used MBeans to monitor web catalogs by logging in and checking for certain items. By the use of the JMX protocol adaptors, you can combine all of your management tools into one. If you have already invested in SNMP managment, you can still leverage it by using a SNMP adaptor. I realize that is somewhat trivial, but we have seen it work nicely.
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
(q) is JMX yet another API?
I think some people could argue that JMX in yet another API because it satisifies needs that can be readily be solved while developing new applications, etc. "You need monitoring, I will build it into the software!" However, JMX buys you a standard, rapid, way of combining all your management needs into one place. Application developers can focus on writing small MBeans for their applications rather than an entire managementn framework. In addition, JMX lets you leverage existing management technology. Another argument for using JMX is its ability to expose business logic for debugging and troubleshooting. By exposing not only the configuration part of applications, but also certain operations, you can really provide flexibility and reliability into your software. In other words, JMX consoles can do more than reporting errors, they can be used as admin consoles, adding/removing users, moving workflows along, etc.
Ben Sullins
Guest Author
Greenhorn

Joined: Oct 07, 2002
Posts: 19
(q) how is our book different?
We feel our book is the most in depth book out there right now. It is true, when explaining JMX, you have to somewhat familiar pattern. However, we tried to do things a little differently. In describing the JMX architecture, we discuss what it buys you in addition to just "here is how JMX fits together". By describing MBeans, we provide best practices for building MBeans, and when you should use each type, not just "here is how to make a Standard MBean" (we answer questions like why you should choose one type over another).
We cover the notification system, but we also show you how to extend the system to use it to recover from application errors.
We cover each of the agent services in more depth than anything out there right now. For the relation service, we demonstrate not only how to create MBean relationships, but how to use them to model a workflow management tool (a simple one, but the ideas are there :-) ).
For the M-let (dynamic MBean loading) service, we not only show how to use it, but how to extend it to make it more useful. In addtion, we provide unique adapters like the Jini adapter and TCP adapter, and conclude the book combining JMX with JMS and EJB applications. In addition, we provide a helper utility class for coding Dynamic MBeans (which can be tedious), and an example of an MBean generator that reads the remote interface of an EJB and creates MBeans that expose its methods.
Back to work for a bit- be back later!
Mandan Happy
Ranch Hand

Joined: Dec 17, 2001
Posts: 65
Thanks for your mails.
Lemme get the book first and then I 'll post more !!
TCP Adaptor?
regards
Mandan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: This weeks giveaway "JMX in Action"
 
Similar Threads
This weeks giveaway
This weeks giveaway
This weeks giveaway
This weeks giveaway
This weeks GiveAway