Hi Matthew,

On 8/5/07, Matthew Phillips <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a timer thread inside a custom IoFilter that checks for
> request timeouts after sending a message. If a timeout occurs, it
> sends a synthetic message down the filter chain. The question is, is
> this thread safe, or am I violating the MINA thread model?

It should be safe as long as your business logic is thread safe.  If
not, please let us know.

> The following code is what I'm doing in the timer thread to inject
> the message:
>
>   String filterName = ... // name of the timeout-checking filter
>
>   NextFilter filter =
>     session.getFilterChain ().getNextFilter (filterName);
>
>   filter.messageReceived
>     (session, new RequestTimeoutMessage ());
>
> Any advice appreciated,

Looks great!

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

Reply via email to