Write a resource adapter. In it's start() method, start a timer using
the JCA Timer / Workload API. Using RAFC
(
http://sourceforge.net/projects/rafc) that is done in less than one
hour. We are using that in our production-grade enterprise application
to handle even thousands of timers dynamically. In fact, JCA is great
for problems like this one. :-)
Have Fun
Markus
Dru Devore schrieb:
> Yes, I am trying to do it as an EJB though it doesn't need to be a
> EJB. I am presently looking at the EJB Timer API though I am not
> having much luck with the stating thing. I need to schedule it upon
> startup but I am developing it in NB and can't create a servlet in the
> ejb project I have for the bean, I need it to be a self contained ejb
> project if that makes any since.
>
>
> ---
> Dru Devore
>
>
> -------- Original Message --------
> Subject: Re: Scheduled task
> From: Markus KARG <markus.karg_at_gmx.net>
> Date: Fri, February 29, 2008 12:22 pm
> To: users_at_glassfish.dev.java.net
>
> I expect with "task" you mean "running an EJB"? Then I would
> propose a
> message driven bean that uses EJB Timer API, or a resource adapter.
>
> Dru Devore schrieb:
> > I am in the need of having a scheduled task in my server, I
> would say
> > daemon but not sure if that would give the right impression.
> Basically
> > I need to have a task that will start up every X minutes and run. I
> > did this once many years ago with a servlet and threads, I think
> that
> > is how I did it though it was many years ago so I am not
> positive that
> > is 100% correct.
> >
> > What is the best way to have a task kicked off every X minutes with
> > only one instance running at a time for the life of a cluster?
> >
> >
> > ---
> > Dru Devore
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> <http://email.secureserver.net/pcompose.php#Compose> For
> > additional commands, e-mail: users-help_at_glassfish.dev.java.net
> <http://email.secureserver.net/pcompose.php#Compose>
>
>
> --
> http://www.xing.com/go/invita/58469
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net For
> additional commands, e-mail: users-help_at_glassfish.dev.java.net
--
http://www.xing.com/go/invita/58469