[jboss-user] [EJB/JBoss] - Re: Accessing properties from jboss
veeseekay
do-not-reply at jboss.com
Fri Apr 20 00:33:50 EDT 2007
I could finally access the props specified in jboss-service.xml through an MBean, initially I had mentioned that I did not want to do it through MBean, but now due to a change, I have to do this, and here is an FYI on how to do it :
1) specify your key-value pairs in jboss-service.xml
Ex :
<!-- Additional properties required by the environment -->
<![CDATA[
Key1=11111
Key2=22222
.....
2)Now in your management bean, put an @Depends
Ex:
package com.abc.xyz;
// your import statements
/**
* @author somebody
*
*/
@LocalBinding(...)
@Service(...)
@Management(...)
@Depends("jboss.util:type=Service,name=SystemProperties")
public class MBeanClass implements MBeanInterface {
...
}
3)Now in your Mbean you can access the props with a System.getProperty() call.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039122#4039122
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039122
More information about the jboss-user
mailing list