[concurrency-interest] How to handle multiple different requests and still have a thread dedicated to monitoring timeouts in the background.

Chhabria, Kavita - Apogent kchhabria@apogent.com
Wed, 7 Jan 2004 16:43:39 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C3D567.501AD770
Content-Type: text/plain

Greetings Everyone:
 
I have a need to design a class that receives different kinds of jabber
messages.  Based on the content of the jabber messages, different
actions/tasks have to be executed.  I have to create a new user request
object for every new request that is valid that is sent via a jabber
message.  These requests are valid only for a certain period of time.  So,
for every new request that was created, i have to have a thread that willl
continuously loop through all the user request instances and check if they
have timed out.  If a user request has timed out, it needs to be removed
from the database.  
 
How should I design my classes such that I have these different runnable
commands that are executed upon receiving different jabber messages, and
then simultaneously one thread needs to constantly monitor the timeout
values for the user request objects that were created.  Should I create this
thread as a daemon thread or are there any other options within the
concurrent.util package that I am unaware of.
 
Thanks a lot,
 
Kavita Chhabria
Systems Developer
Apogent Technologies
(269) 544-7515
 <mailto:kchhabria@apogent.com> kchhabria@apogent.com
 

------_=_NextPart_001_01C3D567.501AD770
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2800.1276" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=456153521-07012004>Greetings 
Everyone:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=456153521-07012004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=456153521-07012004>I have a need to 
design a class that receives different kinds of jabber messages.&nbsp; Based on 
the content of the jabber messages, different actions/tasks have to be 
executed.&nbsp; I have to create a new user request object for every new request 
that is valid that is sent via a jabber message.&nbsp; These requests are valid 
only for a certain period of time.&nbsp; So, for every new request that was 
created, i have to have a thread that willl continuously loop through all the 
user request instances and check if they have timed out.&nbsp; If a user request 
has timed out, it needs to be removed from the database.&nbsp; 
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=456153521-07012004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=456153521-07012004>How should I design 
my classes such that I have these different runnable commands that are executed 
upon receiving different jabber messages, and then simultaneously one thread 
needs to constantly monitor the timeout values for the user request objects that 
were created.&nbsp; Should I create this thread as a daemon thread or are there 
any other options within the concurrent.util package that I am unaware 
of.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=456153521-07012004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=456153521-07012004>Thanks a 
lot,</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV align=left><FONT face=Arial size=2>Kavita Chhabria</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Systems Developer</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Apogent Technologies</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>(269) 544-7515</FONT></DIV>
<DIV align=left><A href="mailto:kchhabria@apogent.com"><FONT face=Arial 
size=2>kchhabria@apogent.com</FONT></A></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C3D567.501AD770--