On Sat, Jun 14, 2008 at 1:23 AM, Paul Benedict <[EMAIL PROTECTED]> wrote:
> We just have to figure out how to do that in Struts. What would it mean to
> configure Struts in an OSGi container?

Well, it seems that you guys have not defined what you mean by "OSGify
Struts". There are several levels possible.

As you have probably noted, the main issue is regarding the "loading
of a class from a string" and related issues.

One possible way to become OSGi-friendly is to locate all places where
you do some form of ClassLoader.loadClass() or Class.forName() and
delegate that to an implementation of a ClassFactory (or whatever you
want to call it) and that ClassFactory implementations can register
themselves into Struts. Your own default implementation use the
ThreadContextClassLoader, whereas in the OSGi case, I would suggest an
implementation that looks for ClassFactory services to delegate to.
Whether or not you provide this final bit is less important...

Also note that if you do any kind of deserialization, you have
additional class loading concerns in there...


Cheers
Niclas

Reply via email to