Re: [JBoss-user] Service bean
MBeans are not JBoss-specific, they are defined by Sun. I'm fairly new to MBeans myself, but if you elect to use the JBoss helper classes, then your MBean implementation becomes JBoss-specific, but you don't have to do that. MBeans can indeed use other MBeans; the dependencies are resolved by the relative position of the MBeans in the jboss.jcml file. JBoss will make sure that MBeans listed earlier are started before those listed later. I just returned from the US Thanksgiving weekend, so I've lost track of your original post. If you want to stick with a servlet based approach, I'm pretty sure Tomcat has a load-on-start option. You'll of course have to write the timer logic yourself (which may be the weak point you are hinging your decision upon.) - Original Message - From: Krzysztof Ogrodnik [EMAIL PROTECTED] To: Guy Rouillier [EMAIL PROTECTED] Sent: Wednesday, November 21, 2001 9:10 AM Subject: Re: [JBoss-user] Service bean On Tue, 20 Nov 2001 00:13:36 -0500, you wrote: You don't say what your service does, so it is difficult to make an assessment. Have you looked at MBeans? They are specifically designed for implementing services that start up with JBoss and keep running the whole time. I just implemented my first one, and it was pretty easy. Thank you for your answer. All my service bean has to do is to periodically call method on a stateless session bean that will do the rest: analyze data from several databases and move it between them - see my other post on the list: Subject: [JBoss-user] Multiple data sources Message-ID: [EMAIL PROTECTED] I agree that implementing special MBean would be probably the best solution (athough it will work with JBoss only) but I don't think I should do it until I find some weak points of my first (probably simpler) solution (servlet loaded on deployment time registering and scheduling tasks). BTW is it possible to write an mbean that uses (requires) another MBean (timer service)? Kind regards. -- Krzysztof Ogrodnik mailto:[EMAIL PROTECTED] ICQ2963634 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Service bean
On Tue, 20 Nov 2001 00:13:36 -0500, you wrote: You don't say what your service does, so it is difficult to make an assessment. Have you looked at MBeans? They are specifically designed for implementing services that start up with JBoss and keep running the whole time. I just implemented my first one, and it was pretty easy. Thank you for your answer. All my service bean has to do is to periodically call method on a stateless session bean that will do the rest: analyze data from several databases and move it between them - see my other post on the list: Subject: [JBoss-user] Multiple data sources Message-ID: [EMAIL PROTECTED] I agree that implementing special MBean would be probably the best solution (athough it will work with JBoss only) but I don't think I should do it until I find some weak points of my first (probably simpler) solution (servlet loaded on deployment time registering and scheduling tasks). BTW is it possible to write an mbean that uses (requires) another MBean (timer service)? Kind regards. -- Krzysztof Ogrodnik mailto:[EMAIL PROTECTED] ICQ2963634 perl -le 's**02).49%4^[./4(%2^0).+^=,/9\$^=!.**y% -;=^[%`-{f a%%s%%$_%ee' -- Tego nie znajdziesz w zadnym sklepie! [ http://oferty.onet.pl ] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Service bean
You don't say what your service does, so it is difficult to make an assessment. Have you looked at MBeans? They are specifically designed for implementing services that start up with JBoss and keep running the whole time. I just implemented my first one, and it was pretty easy. - Original Message - From: Krzysztof Ogrodnik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 19, 2001 4:22 AM Subject: [JBoss-user] Service bean Hi, I am new to EJB and JBoss. Recently I have started a project which requires something like service bean. By this I mean: - bean starts when the server (application) starts (is deployed) - bean receives time notifications (I can specify the period) How to do it using JBoss? My solution is to create web application (as part of enterprise application - in ear) that will contain servlet that will load on application deployment time (load-on-startup in web.xml). Then in the init method I would read information about tasks and their periods from servlet's parameters and schedule them. One solution to schedule them is to use JMX timer service available in JBoss and register the servlet as a notification handler. The other solution (more portable) is to use Timer and TimerTask to schedule tasks. I have developed such servlet, tested it and it seems to work. My question is: is it a correct way to do it? Maybe there are some better ways... What are the dangers and weak points of my solution and what do you think about it? Thank you very much for your answer. Kind regards. -- Krzysztof Ogrodnik mailto:[EMAIL PROTECTED] ICQ2963634 perl -le 's**02).49%4^[./4(%2^0).+^=,/9\$^=!.**y% -;=^[%`-{f a%%s%%$_%ee' -- Tego nie znajdziesz w zadnym sklepie! [ http://oferty.onet.pl ] ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user