Thanks Benjamin.  That's extremely helpful.

Regards

Eric

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Geer,
Benjamin
Sent: Tuesday, December 10, 2002 11:24 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [JBoss-user] J2ee spec thoughts


Eric Kaplan wrote:
> What's my best resource for understanding how to turn this
> thing into an mbean and then have the mbean accessed via slsb's?

One easy approach:

1. Write an MBean interface for your component, extending
org.jboss.system.ServiceMBean.

2. Write the implementation of your MBean, extending
org.jboss.system.ServiceMBeanSupport.

3. In your MBean's startService() method, have it register itself in the
JNDI namespace.  The issue here is that you don't want it to be
serialised; you want it to be passed by reference to classes that look
it up in JNDI.  You can accomplish this by using the convenience classs
org.jboss.naming.NonSerializableFactory.  (See the source code of that
class for details; you can also find examples of how to use it elsewhere
in the JBoss source code.)

4. Write a something-service.xml file, along the lines of
user-service.xml (in your JBoss 'deploy' directory), so your MBean will
be started when JBoss starts.

5. EJBs and other classes can now get a reference to your MBean using
new InitialContext().lookup().

For details on (1), (2) and (4), see the JBoss Administration and
Development Guide.

Benjamin



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to