dev@grizzly.java.net

Re: ConnectionManagement/Cache integration

From: Ken Cavanaugh <Ken.Cavanaugh_at_Sun.COM>
Date: Mon, 04 Jun 2007 09:29:36 -0700

Oleksiy Stashok wrote:
>
>
> Ken Cavanaugh wrote:
>> Oleksiy Stashok wrote:
>>> Current usecase is:
>>> connect() -> cache.get()
>>> send()
>>> receive()
>>> .........(some client connection actions)................
>>> close() -> cache.release(0)
>>>
>>> which means that connection is supposed to be busy until it will be
>>> explicitly closed.
>>>
>> The general assumption is that a request requires a response, but
>> this is indicated by the
>> numberOfResponses parameter (or whatever I called it) on the release
>> method. If a response is
>> expected, a release may make the connection idle, but it won't make
>> it available for reclamation.
>> Reclamation can only happen on connections that are idle AND have no
>> expected responses.
>> That's why I need both release and responseReceived: I need to tell
>> that cache both that
>> connections are idle (no writes) and no responses are expected (no
>> reads expected).
> What about release(Connection, 0)?
> I suppose it makes Connection idle and reclamation available?
>
That's correct, assuming that the connection is not otherwise already in
use, or waiting for
another response.

Ken.