For anyone who might be interested, this is what I ended up with for a
scheduler:
public class AServletContextListener implements ServletContextListener
{
private ScheduledExecutorService executor;
/**
* Constructs AServletContextListener object.
*/
public AServletCont
On 1:59 PM, Mark Thomas wrote:
On 14/07/2011 23:59, Terence M. Bandoian wrote:
On 1:59 PM, Mark Thomas wrote:
On 14/07/2011 06:11, Terence M. Bandoian wrote:
I can live with this. It's just one of those "it would be nice not to
have to explain" things and if Thread.sleep does the trick, I'
On 14/07/2011 23:59, Terence M. Bandoian wrote:
> On 1:59 PM, Mark Thomas wrote:
>> On 14/07/2011 06:11, Terence M. Bandoian wrote:
>>> I can live with this. It's just one of those "it would be nice not to
>>> have to explain" things and if Thread.sleep does the trick, I'm happy.
>>> As I mention
On 1:59 PM, Mark Thomas wrote:
On 14/07/2011 06:11, Terence M. Bandoian wrote:
I can live with this. It's just one of those "it would be nice not to
have to explain" things and if Thread.sleep does the trick, I'm happy.
As I mentioned in my original post, I wanted to find out if there was a
an
On 14/07/2011 06:11, Terence M. Bandoian wrote:
> I can live with this. It's just one of those "it would be nice not to
> have to explain" things and if Thread.sleep does the trick, I'm happy.
> As I mentioned in my original post, I wanted to find out if there was a
> another way to accomplish the
On 1:59 PM, Pid wrote:
On 14/07/2011 06:05, Terence M. Bandoian wrote:
On 1:59 PM, Pid wrote:
ATimerTask is a private instance in AServletContextListener, is this
necessary and if so, why?
What logic is contained in ATimerTask?
Are you overriding TimerTask.cancel() and do you catch
Interru
On 14/07/2011 06:05, Terence M. Bandoian wrote:
> On 1:59 PM, Pid wrote:
>>
>> ATimerTask is a private instance in AServletContextListener, is this
>> necessary and if so, why?
>>
>> What logic is contained in ATimerTask?
>>
>> Are you overriding TimerTask.cancel() and do you catch
>> InterruptedE
On 1:59 PM, Bill Miller wrote:
The problem is obviously that the thread within the Timer needs time to
properly shutdown, the
non-obvious part is "how long does it need, and how do you detect it's done?".
Normally you would do
a Thread.join() to ensure a thread has stopped before continuing, b
On 1:59 PM, Christopher Schultz wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Terence,
On 7/12/2011 3:47 PM, Terence M. Bandoian wrote:
executorService.shutdown();
try { while ( !executorService.awaitTermination( 1, TimeUnit.SECONDS
) );
Thread.sleep( 1000 ); } catch ( InterruptedExc
On 1:59 PM, Pid wrote:
ATimerTask is a private instance in AServletContextListener, is this
necessary and if so, why?
What logic is contained in ATimerTask?
Are you overriding TimerTask.cancel() and do you catch InterruptedException?
p
Hi, Pid-
For the sake of clarity, I'll repeat this h
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Terence,
On 7/12/2011 3:47 PM, Terence M. Bandoian wrote:
> executorService.shutdown();
>
> try { while ( !executorService.awaitTermination( 1, TimeUnit.SECONDS
> ) );
>
> Thread.sleep( 1000 ); } catch ( InterruptedException ie ) { }
We use a Thre
gt; Thanks.
>
> -Terence Bandoian
>
> On 1:59 PM, Kris Schneider wrote:
>> On Tue, Jul 12, 2011 at 7:59 AM, Caldarale, Charles R
>> wrote:
>>>> From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
>>>> Subject: Terminating Timer Thread Gracefully
e to control Timer objects??)
Bill
-Original Message-
From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
Sent: July 12, 2011 3:47 PM
To: Tomcat Users List
Subject: Re: Terminating Timer Thread Gracefully
Hi, Kris-
I tried using ScheduledExecutorService but ran into the same pr
, Jul 12, 2011 at 7:59 AM, Caldarale, Charles R
wrote:
From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
Subject: Terminating Timer Thread Gracefully
Finally, in contextDestroyed, I inserted a call to
Thread.sleep after canceling the timer and the error
message disappeared.
You should be able
Thanks to all who replied.
Functionally, the servlet context listener is implemented as follows:
public class AServletContextListener implements ServletContextListener
{
private Timer timer;
private ATimerTask timerTask;
public AServletContextListener()
{
}
public void
On Tue, Jul 12, 2011 at 10:03, David kerber wrote:
> On 7/12/2011 9:59 AM, Kris Schneider wrote:
>
>> On Tue, Jul 12, 2011 at 7:59 AM, Caldarale, Charles R
>> wrote:
>>
>>> From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
>>>>
On Tue, Jul 12, 2011 at 10:03 AM, David kerber wrote:
> On 7/12/2011 9:59 AM, Kris Schneider wrote:
>>
>> On Tue, Jul 12, 2011 at 7:59 AM, Caldarale, Charles R
>> wrote:
>>>>
>>>> From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
>
On 7/12/2011 9:59 AM, Kris Schneider wrote:
On Tue, Jul 12, 2011 at 7:59 AM, Caldarale, Charles R
wrote:
From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
Subject: Terminating Timer Thread Gracefully
Finally, in contextDestroyed, I inserted a call to
Thread.sleep after canceling the
On Tue, Jul 12, 2011 at 7:59 AM, Caldarale, Charles R
wrote:
>> From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
>> Subject: Terminating Timer Thread Gracefully
>
>> Finally, in contextDestroyed, I inserted a call to
>> Thread.sleep after canceling the tim
> From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
> Subject: Terminating Timer Thread Gracefully
> Finally, in contextDestroyed, I inserted a call to
> Thread.sleep after canceling the timer and the error
> message disappeared.
You should be able to do a Thread.join() us
On 7/12/2011 4:11 AM, Pid wrote:
On 12/07/2011 02:06, Terence M. Bandoian wrote:
Hi-
I've been testing a web application on:
Tomcat 6.0.32 (32-bit)
Sun/Oracle JRE 1.6.0_25 (32-bit)
Windows Server 2008 R2
The web application includes a ServletContextListener which creates a
Timer in the cont
On 12/07/2011 02:06, Terence M. Bandoian wrote:
> Hi-
>
> I've been testing a web application on:
>
> Tomcat 6.0.32 (32-bit)
> Sun/Oracle JRE 1.6.0_25 (32-bit)
> Windows Server 2008 R2
>
> The web application includes a ServletContextListener which creates a
> Timer in the contextInitialized me
Hi-
I've been testing a web application on:
Tomcat 6.0.32 (32-bit)
Sun/Oracle JRE 1.6.0_25 (32-bit)
Windows Server 2008 R2
The web application includes a ServletContextListener which creates a
Timer in the contextInitialized method to perform periodic maintenance.
To no avail, I spent quite
23 matches
Mail list logo