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]  ICQ>>2963634             
perl -le 's**02).4&9%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

Reply via email to