Hello All
I've a situation where I've to deploy a MBean which is a config service (basically it
is a startup class that gets the properties and configurations from database at the
startup). One this is deployed, I'll have to lookup for this service to call methods
on it. For example, configMBean.getConfigForTestServer() should get me the
configuration details for my test server.
I've followed the rules of SAR process and deployed with the following snip from
jboss-service.xml
| <mbean code="playground.org.ms.mbeans.ConfigService"
| name=":service=ConfigService,name=ConfigService">
| <attribute name="JndiName">ConfigService</attribute>
| </mbean>
|
My Question(s):
1. After successful deployment, I'm unable to see this MBean bound to JNDI
NamingService. I didn't find the ConfigService in JNDIView. Is there anything I've to
do to reflect this service into JNDI NS? I don't want to use NonSerializableFactory
methods to do this. Am I assuming that deploying the MBean with the above
configuration will bind to JNDI? If yes, what is the way I can do this?
2. If I know the JNDI Name, Is it right to lookup for this Bean as follows(JRun didn't
have any problem for this kind of lookup and getter):
| Context ctx = ...
| Object obj = ctx.lookup("ConfigService");
| Object mbean = PortableRemoteObject.narrow(obj,ConfiService.class)
| // now I got the bean, I call the methods on this?
| Configuration conf = mbean.getConfigForTestServer();
|
3. I understand I can use RMIAdaptor to invoke the methods on the MBean. The only
disadvantage in this way is the client should import jboss class(RMIAdaptor) which is
not an ideal way. So I'm tending to go the alternative suggested above.
4. The alternative in question worked perfectly fine with JRun. I'm assuming there
should be some way to do in JBoss as well.
Advane Thanks to All
X
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834595#3834595
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834595
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user