added osgi MessageListener support; rewritten discovery and shared session to use it