[Red5devs] Spring Application startup & embedding/integrating into existing apps
mondain at gmail.com
Thu Aug 23 08:32:30 PDT 2007
Thanks for the feedback. You will be happy to know that I'm already in the
process of cleaning this up, stay tuned.
On 8/23/07, Les Hazlewood <les at hazlewood.com> wrote:
> Hi all,
> I've been using Red5 in production for quite a while and I've been
> embedding it into some of my Spring-based applications a lot more
> However, when embedding it the first time, I had to jump through quite a
> few hoops to get it to work properly. I basically took the war
> distribution, used the spring config files and lib dependencies, added
> them to my own project (with its own Spring files), modified the war's
> web.xml to suit my needs, and I was off and running.
> Well - this is somewhat of a painful process. I started to write an
> article on how to do this cleanly, but I thought it would be a better
> idea to actually address the issue here so that whatever changes I did
> might be reviewed by you all and perhaps incorporated into the project.
> Basically, my immediate frustrations were based off of
> org.red5.server.MainServlet that 'impersonates' a ContextLoaderListener.
> It forces me to call the 'root' Spring file applicationContext.xml,
> which is less than ideal - it doesn't allow me to change the name based
> on my project needs. (For example, we have many applications built
> around the concept of modules. Each module has a spring config file
> <modulename>.spring.xml. So forcing a name on my project isn't as
> 'nice', but not really a problem - I can deal with it, its just not as
> clean as I would like.
> A bigger problem for me was specifying the contextConfigLocation servlet
> context parameter. I had entries each on their own line. It took me
> over an hour to figure out that the MainServlet didn't account for
> newlines in that property (I had to download the source code, trace
> through the code, etc). It could have saved me a lot of time and
> frustration if Red5 just piggy-backed what Spring already has.
> Spring's ContextLoaderListener allows for this functionality and a
> little more. I wanted to subclass the ContextLoaderListener to do what
> the MainServlet does now - I feel that is a much cleaner approach than
> trying to roll your own.
> Does anyone have any objections to me making modifications to the source
> code and submitting a patch for your review? I think this would do two
> very powerful things for Red5 and its community:
> 1) Allow easy embedding of red5 into an existing Spring application.
> This is primarily what the above is concerned about, but has massive
> implications to the many people that are already using Spring/Hibernate
> for other things - it'd be really nice to _easily_ drop red5 into place
> instead of having to have their application _inside_ red5. I know it is
> deployment semantics, but conceptually and pragmatically still very
> 2) Still retain red5's standalone deployment without any changes - it'd
> work in both environments.
> I've pondered this possibility for a while and have been using red5
> since 0.3 (I'm very familiar with its design patterns and source code).
> I think this could help a lot of folks out (not just me), which is why
> I'd like to get your feedback.
> Les Hazlewood
> Red5devs mailing list
> Red5devs at osflash.org
It is difficult to free fools from the chains they revere. - Voltaire
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Red5devs