Session listener

Details

Description

Allow to add listener for major event (such as when |close| method is fired) about SSH Session instance.

Currently I've worked around by implementing my own SessionFactory, which itself return custom Session instances supporting such listener.
With a listener on standard/provided Session instance may not require user to to do such custom implementations.

Hi Cédric,
While reviewing this patch, it occured to me that it may be better to add the listeners for sessions at a upper level so that the listeners could be informed when sessions are created. I think that would be more symetric and would allow a single listener to be registered instead of having to register it for each session.

Guillaume Nodet
added a comment - 05/Apr/11 12:05 Hi Cédric,
While reviewing this patch, it occured to me that it may be better to add the listeners for sessions at a upper level so that the listeners could be informed when sessions are created. I think that would be more symetric and would allow a single listener to be registered instead of having to register it for each session.

In current patch, listeners are also added at SessionFactory level. As far as I understand it could match your expectation.
As for listeners at Session level, I have thought that some people would prefer to "monitor" not all session but just some of them.
It could be removed if no one think it could be useful.

Cédric Chantepie
added a comment - 05/Apr/11 13:17 In current patch, listeners are also added at SessionFactory level. As far as I understand it could match your expectation.
As for listeners at Session level, I have thought that some people would prefer to "monitor" not all session but just some of them.
It could be removed if no one think it could be useful.