-
1. Re: Alternative for MBeans of older versions
jaikiran Dec 24, 2014 6:32 AM (in response to valsaraj007)1 of 1 people found this helpfulOne way is the portable Java EE @Startup @Singleton EJBs http://docs.oracle.com/javaee/6/tutorial/doc/gipvi.html
-
2. Re: Alternative for MBeans of older versions
valsaraj007 Dec 24, 2014 7:02 AM (in response to jaikiran)Thanks Jaikiran!
Like we set attributes of MBean from configuration file, is it possible to pass values to initialize singleton EJB from standalone.xml?
-
3. Re: Alternative for MBeans of older versions
jaikiran Dec 24, 2014 8:45 AM (in response to valsaraj007)1 of 1 people found this helpfulDepending on what kind of parameters those are, you can pass them through ejb-jar.xml in the form of env-entry (take a look at the ejb-jar xsd or javaee xsd for more details).
-
4. Re: Alternative for MBeans of older versions
valsaraj007 Dec 29, 2014 6:50 AM (in response to jaikiran)Hi jaikiran,
If I add a @Startup @Singleton EJB into my custom jar file of my custom module, it will be triggered on startup? I have to add explicit dependency to ejb module from my custom module?
Thanks in advance!
-
5. Re: Alternative for MBeans of older versions
jaikiran Dec 29, 2014 6:54 AM (in response to valsaraj007)The @Startup @Singleton (or for that matter any EE component) has to be deployed as a deployment and not as a JBoss module for it to be picked up. So package that @Startup @Singleton in a .jar and deploy it as a deployment (either through file system deployment mechanism or other management API based mechanisms).
-
6. Re: Alternative for MBeans of older versions
valsaraj007 Dec 29, 2014 7:30 AM (in response to jaikiran)Hi jaikiran,
This jar file contains classes (custom login modules) that are used by the datasource configurations. So if we wait for AS startup and then deploy it to JBoss, we will get ClassNotFoundException from datasource. We got this error initially and it fixed when these jars are added into a custom module. The @Startup @Singleton EJB triggers encryption of passwords for DB and stores it in a password store which will be used by the custom login modules specified in the datasource configuration.
Thanks!
-
7. Re: Alternative for MBeans of older versions
valsaraj007 Dec 31, 2014 6:38 AM (in response to valsaraj007)Hi jaikiran,
I have executed code on startup using custom module and data source. Written the code in the class that is called by security domain and specified this domain in a dummy data source. In fact this data source is never used for connection but it executed code that I needed. Is there any other better approach to do this?
Thanks!
-
8. Re: Alternative for MBeans of older versions
jaikiran Jan 4, 2015 11:47 PM (in response to valsaraj007)You don't need dummy datasource for this, IMO. I don't know the details of your application, but from what you are saying it appears that this initialization should be happening in the implementation of your LoginModule class or maybe the CallbackHandler implementation.
-
9. Re: Alternative for MBeans of older versions
valsaraj007 Jan 5, 2015 3:25 AM (in response to jaikiran)Hi jaikiran,
I want to initialize my password store before processing data source configuration. The problem was I need to trigger this as the first step before processing DS. What is the alternate solution?
Thanks!