<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="IncrediMail 1.0">
<STYLE>
v\:* {behavior:url (#default#vml);}
</STYLE>

<!--IncrdiXMLRemarkStart>
<IncrdiX-Info>
<X-FID>FLAVOR00-NONE-0000-0000-000000000000</X-FID>
<X-FVER>0.000000</X-FVER>
<X-CNT>;</X-CNT>
</IncrdiX-Info>
<IncrdiXMLRemarkEnd-->
</HEAD>
<BODY style="MARGIN: 5px 10px 0px; FONT-FAMILY: Arial; FONT-SIZE: 12pt" background="" scroll=yes bgColor=#ffffff>
<TABLE id=INCREDIMAINTABLE border=0 cellSpacing=0 cellPadding=2 width="100%">
<TBODY>
<TR>
<TD style="POSITION: relative; DIRECTION: ltr; FONT-SIZE: 12pt" id=INCREDITEXTREGION width="100%">
<DIV style="PADDING-LEFT: 2px" id=INCREDI_TEXT_AREA>
<DIV style="PADDING-LEFT: 2px" id=INCREDI_TEXT_AREA>
<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Is it possible to pass a class reference to HashedWheelTimer while setting a newTimeout job.</DIV>
<DIV>&nbsp;</DIV>
<DIV>What I want achieve is using a single HashedWheelTimer object to execute a method at fixed interval for each connected client. This method is part of business logic and deals with user instance, so defined inside channel handler (which is extending IdleStateTimer) and stateful.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I defined a HashedWheelTimer already for idlestate detection in my custom pipeline factory. I thought of defining another one in my main class as static member&nbsp;(or even using the same existing instance) to schedule task for each client based on condition. Task could be like after every 20 second send update to client A, after every 15 second send list of clients to client B (means not a single task and depends on conditions and client instance).</DIV>
<DIV>&nbsp;</DIV>
<DIV>One option could be that I extend TimerTask and pass &amp; store my logic class reference to that. Then&nbsp;add&nbsp;a time out task using&nbsp;HashedTimeoutTask.newTimeout(task, delay, unit) where task is object of CustomTimerTask type.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Using separate Timers doesn't sound like a good idea to me, as that's not performance friendly option. Because then it will create a separate thread to manage timer for each connected client. Other option which I thought for a moment is using something like quartz-scheduler, but then it will make stuff little complex for me.</DIV>
<DIV>&nbsp;</DIV>
<DIV>If its not a proper way to do&nbsp;what I am trying, could any one suggest a better or proper way. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Kirtimaan</DIV></DIV></DIV></TD></TR>
<TR>
<TD id=INCREDIFOOTER width="100%">
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD width="100%"></TD>
<TD id=INCREDISOUND vAlign=bottom align=middle></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><SPAN id=IncrediStamp><A href="http://www.incredimail.com/?id=606430&amp;rui=131362166&amp;sd=20101118"><SPAN name="imgCache" border="0"><IMG border=0 alt="FREE Animations for your email - by IncrediMail! Click Here!" src="cid:29ED1A8B-BDD1-4689-83D4-2E21B798E8B9"></SPAN></A></SPAN></BODY></HTML>