Hi 

Trustin said:

"You have to purge them manually"

Does this mean that I need to call "executorService.shutdownNow();"
In a finally {} block. Will this free up memory consumed by the task?


thanks

Arul Kumaran
Senior Java/J2EE  developer/designer
Woolworths Limited

P 02 8885 7528 
E [EMAIL PROTECTED]

1 Woolworths Way Bella Vista, NSW 2153
PO Box 8000 Baulkham Hills, NSW 2153
P PLEASE CONSIDER THE ENVIRONMENT BEFORE YOU PRINT THIS E-MAIL


-----Original Message-----
From: Trustin Lee [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 23 October 2007 11:36 AM
To: dev@mina.apache.org
Subject: Re: TIMEOUT on messageReceieved


On 10/22/07, Kumaran Arul <[EMAIL PROTECTED]> wrote:
> Hi
>
>
> I have my business service method invoked from my
messageReceived(IoSession session, Object message) of my implementation
of the IoHandlerAdapter class.
>
> How can I timeout my service call using MINA? Is using
java.util.concurrent.ScheduledThreadPoolExecutor the only way to go?

I think so.  Be aware of OOM because SchduledThreadPoolExecutor holds
tasks until timeout comes even if they are all cancelled.  You have to
purge them manually if you are processing many messages within short
timeframe.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

***********************************************************
CAUTION: This email and files included in its transmission 
are solely intended for the use of the addressee(s) and may 
contain information that is confidential and privileged. 
If you receive this email in error, please advise us 
immediately and delete it without copying the contents 
contained within. Woolworths Limited (including its group 
of companies) do not accept liability for the views 
expressed within or the consequences of any computer 
viruses that may be transmitted with this email. The 
contents are also subject to copyright. No part of it 
should be reproduced, adapted or transmitted without the 
written consent of the copyright owner.
***********************************************************

Reply via email to