On Feb 10, 2010, at 11:31 PM, Emmanuel Lecharny wrote:
On Wed, Feb 10, 2010 at 11:33 PM, Alan D. Cabrera <[email protected]
>wrote:
On Feb 4, 2010, at 1:26 AM, Emmanuel Lecharny wrote:
Hi guys,
I'm looking with the listener Interface. Listeners can be attached
to a
IoService in order to react on some events. In MINA 2, the list of
events
those listener can be activated for is :
- service activation
- service deactivation
- service idle
I'm not entirely sure what a service is. My confusion lies in my
experience as a service being a very application specific thing.
This being
said, I'm not sure it belongs to a communications API.
In MINA's terminology, a Service is a Connector or an Acceptor. The
listeners are associated with a service activation.
Why call it a service at all? Why not make a ConnectorListener and
AcceptorListener? I say this because a particular stack can be an
amalgam of services coordinating there efforts to provide
functionality to the application.
I'm not sure what can be
an idle service... A Connector/Acceptor with no data being send or
received
for, say, one minute ?
The notion of being idle is not a canonical general thing. What I
mean by that is that a collection of services in a stack could each
have their own notion of what constitutes an idle state. I think that
we shouldn't have this in our listeners, at least for the ones we are
discussing above.
- session created
- session deleted
The notion of sessions is a nebulous thing. For example, I could
have a
stack where "inside" there could be many sessions for every session
that an
application layer sees. To be sure one needs to track sessions
from the
"NIC" standpoint. If what I have said makes sense then I would
create an
IoSessionListener interface.
A Session in MINA is associated with a connection being opened
between a
client and a server. Usually, it does not carry to much data -unless
the
developper wants to inject some into it-, but it's used internally
to store
references to the encoder/decoder to use, or to manage the SSL
negociation
being processed (AFAIR). It's really like a servlet session.
I'm not sure that I get what you try to say about the application
layer and
sessions...
Never mind. Just thinking out loud. I think it's a good idea to have
a session created/deleted listener for ConnectorListener and
AcceptorListener.
Regards,
A;an