Archive for category Spring

Future Stack

I have been searching for answers. My goal is to be able to build Streaming/RichMedia internet applications on a truly stable and robust basis, that leverages the best standard tools available to modern software developers.

Having done most development until now with the powerful but “designed by Committee” Java, and the powerful but “engineered by impatient enthusiasts” Red5 streaming server, with powerful but inadequately backed “nearmiss” OpenLaszlo, I have aquired a taste for something I can really believe in and work with.

After reviewing a number of technologies, the technology stack I’m currently aiming for is :

  • JQuery -where DHTML is needed, JQuery is excellent
  • Flex 3 (+ Air)  -the most ubiquitous and mature RIA technology available
  • Cairngorm framework/PureMVC
  • Wowza/WebORB -not feature rich, but powerful and robust Streaming Media Servers
  • Spring + Hibernate
  • JSecurity - a security framework which, while not perfect, leaves the right decisions to the implementor and keeps complexity at a minimum

This seems to contain a good blend of efficiency, robustness, and long-term technological/corporate survivability.

PureMVC vs. Cairngorm : ( http://www.websector.de/blog/2007/08/10/another-weborb-for-php-login-sample-using-flex-and-puremvc/ http://www.websector.de/blog/2007/08/08/weborb-for-php-login-example-using-flex-3-and-caingorm-221/)

3 Comments

Integrating JSecurity with Wowza Streaming Media Server – Attempt 1

Whenever a method request comes into the server, JSecurity must be able to work out which Subject (person) the request is for, inorder to calculate if that Subject is authorized to access the method being called.

Typically JSecurity stores the Subject in a ThreadLocal because, typically, a single Thread is used to service a single client session. Whenever a new request comes in, therefore, JSecurity can just whip the Subject back out of the Thread executing the method and it knows who it’s dealing with.

Wowza, however, assigns a seperate Thread for every client interaction from a Thread Pool. This breaks the JSecurity scheme in two ways, as between method requests not only is the Subject unlikely to be available (unless by chance the same Thread is picked from the ThreadPool a second time), but the wrong subject from a previous method call may still be attached throwing the whole thing into chaos.

Read the rest of this entry »

No Comments

Spring Security – Overview diagram

The documentation for SpringSecurity’s architecture is good, but perhaps a bit difficult to follow at first.
I drew the following diagram to help me understand how the pieces fit together. It might help you too!

spring security overview diagram

spring security overview diagram

No Comments

Explain the purpose of web.xml and [myapp]-servlet.xml in Spring

There is so much confusing terminology surrounding Java web technologies that it can really put off early adopters. Part of the reason for all this complexity is the level of abstraction that seems to be present in all Java technology – allowing the system to be very precisely tailored to do what you want. Unfortunately – this often means lots of configuration just to tell the system that you want to do something perfectly “ordinary”. It is also important to recognise that the server does a lot of work which you might not see, but which you can determine through configuration.

I hope this post about using Spring will help clarify a few points about handling browser requests/responses using Spring’s MVC (Model/View/Controller) framework.

Read the rest of this entry »

No Comments

Spring beans application context syntax

One of the major advantages of Spring is its “Inversion of Control”. This is generally done with an XML file. Think of it as if you have your various objects lying around that will make up your system, with those object containing getters and setters for other objects they will need. The whole lot is lying there in pieces.

Spring lets you write a configuration that “connects” all these bits together. It’s as if you’re looking in from the outside at all the bits lying around and can then assemble them, saying ObjectA needs something that implements Interface C – “ok, I have four potential components that implement that interface, I think I’ll connect in the second one”.

There is a standard “bean” syntax for doing this.  Don’t worry about the word “bean”. It’s not magic. It just means a Plain Old Java Object (POJO) that isn’t inheriting or implementing complex Interfaces/Class hierarchies and whatnot from some nuts Enterprise Framework.

This standard syntax could be a bit unwieldy, so Spring have created new tags which make configuration simpler and less verbose.

Read the rest of this entry »

No Comments