Also, yes, the spring default.context that red5 uses is shared, but it does it in a strange manner. It's actually doing it via the code in org.red5.server.war.WarLoaderServlet. There's a line of code that looks like this:
factory.registerSingleton("default.context", applicationContext);
I'm not sure how I feel about this, because it makes it hard to chain contexts from shared beans in your ear. For example, if I wanted to put my DAO and hibernate session in a shared context between applications, if I want to use red5 then default.context has to be at the highest level (all my future contexts will have to inherit from that), so it makes it difficult to create a clean hierarchy in your applications. I think I may end up changing that servlet to make my life easier and separating out some logic.
Basically, my goal is to have something like this:
DAO Beans Context/Hibernate -> Red5 Context -> ApplicationA.war
DAO Beans Context/Hibernate -> ApplicationB.war
The DAO Beans Context/Hibernate would be shared across the .ear to all the .wars, but the way red5 registers that context it isn't possible right now, so it has to be:
Red5 Context -> DAO Beans Context/Hibernate -> ApplicationA.war
Red5 Context -> DAO Beans Context/Hibernate -> ApplicationB.war
I guess I'm nitpicking but it's something I'd like to solve.