users@glassfish.java.net

RE: Keeping a timer alive

From: Manfred Riem <mriem_at_manorrock.org>
Date: Thu, 24 Jul 2008 10:48:22 -0600

Hi Dru,

 

While it might seem to be a lot of overhead it is J2EE standard. Spawning a thread

in a servlet is not. The question is if you want to deal with race conditions that are

associated with threading.

 

Manfred

 

From: Dru Devore [mailto:ddevore_at_duckhouse.us]
Sent: Thursday, July 24, 2008 10:31 AM
To: users_at_glassfish.dev.java.net
Subject: RE: Keeping a timer alive

 

I am sure I can make this work though all I really need is a a timer that kicks off a method every X seconds and is managed by someone. Using the servlet I simply had a thread that would sleep for X seconds but I didn't have any management, which could be done if I need to.

Looking at the EJB timer service it looks like a lot of overhead and work to do a run this every X seconds. Is there a solution I am missing or do I need to create a monitor thread for my run every x seconds thread?






-------- Original Message --------
Subject: RE: Keeping a timer alive
From: "Manfred Riem" <mriem_at_manorrock.org>
Date: Thu, July 24, 2008 10:25 am
To: <users_at_glassfish.dev.java.net>

The following URLs come to mind:

 

http://java-x.blogspot.com/2007/01/ejb-3-timer-service.html

http://docs.sun.com/app/docs/doc/820-4496/beahw?a=view

http://www.diotalevi.com/weblog/2006/10/30/java-ee-in-the-trenches-how-to-use-the-timerservice-and-write-a-timer-session-bean/

http://java.sun.com/javaee/5/docs/tutorial/doc/bnboy.html

 

Hope this helps,

Manfred

 

From: Dru Devore [mailto:ddevore_at_duckhouse.us]
Sent: Thursday, July 24, 2008 8:18 AM
To: users_at_glassfish.dev.java.net
Subject: RE: Keeping a timer alive

 

When it was written I am sure there was but I can't think of any presently.

I am looking for examples/tutorials do you have any good ones?






-------- Original Message --------
Subject: RE: Keeping a timer alive
From: "Manfred Riem" <mriem_at_manorrock.org>
Date: Thu, July 24, 2008 9:55 am
To: <users_at_glassfish.dev.java.net>

Any reason why you are not EJB timer service?

 

From: Dru Devore [mailto:ddevore_at_duckhouse.us]
Sent: Thursday, July 24, 2008 7:52 AM
To: glassfish_user
Subject: Keeping a timer alive

 

I have a timer that is running in a servlet in Glassfish and I encountered a problem with it last night, the timer thread stopped. I need a way to ensure the timer is running and if it does stop, to restart it. Is there a way to have the server monitor this or am I hoping for too much?

--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net For additional commands, e-mail: users-help_at_glassfish.dev.java.net

--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net For additional commands, e-mail: users-help_at_glassfish.dev.java.net

--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net For additional commands, e-mail: users-help_at_glassfish.dev.java.net