Daniel Fagerstrom wrote:
> I have worked on implementing the blocks framework in terms of OSGi
> for some time. Not everything is working yet, but I think it is time
> to start discussing the involved ideas.

<snip/>

> A Servlet Service
> -----------------
>
> A bundle that provides a servlet, can register it as a service with a
> declaration like [5]:
>
>   <scr:component name="cocoon.servlet3">
>     <scr:implementation
> class="org.apache.cocoon.blocks.osgi.TestServlet"/>
>     <scr:service>
>       <scr:provide interface="javax.servlet.Servlet"/>
>     </scr:service>
>     <scr:property name="path" value="/test3"/>
>   </scr:component>
>
> compared to the whiteboard adapter we can see some new things, here we
> provide a service to the framework and it can be refered to by the
> name "cocoon.servlet3" (we should use a better naming scheme, I just
> adapted some examples from the specification while implementing the
> above).
>
> The declaration also contains a property: path=/test3, that is looked
> up by the whiteboard adapter and used for mounting the servlet at that
> URI context.

I'm wondering about who's concern it is to define the path where a
bundle is mounted. If it's in the bundle, it is totally self-contained,
but that may lead to name clashes if two bundles have the same name
built in. Isn't the path the responsibility of the hosting environment,
i.e. defined by the people that assemble bundles to create an
application (just like WARs actually)?

<snip/>

> The Block Protocol
> ------------------
>
> OSGi have an URL service that make it possible to dynamically add
> protocols that are available through java.net.URL, much like the
> Excalibur sources. I have reimplemented the block source as an
> URLConnection that is registered as a protocol and can be used like in
> [9] (still buggy code).

What about the JVM-wide static URLStreamHandlerFactory problem? Did
Equinox and/or Felix come up with a solution for this (didn't had time
to catch up lately)?

<snip/>

> Deployment
> ==========
>
> I have not thought that much about deployment of OSGi based blocks,
> and assume Reinhard will have ideas about that.
>
> For packaging the OSGi framework together with needed service bundles
> and an init configuration it is best to see what the Felix and
> Eclipse/Equinox communities have come up with.
>
> Most OSGi implementations provide both telnet and http based consoles
> for installing, starting and stopping bundles. Deploy time
> configuration (wiring.xml) seem to have less well developed tool support.
>
> There is a configuration service that can be used for deploy time
> configuration. With the configuration service one can override the
> properties and target attributes for references that is given in the
> DS files in the bundles.
>
> The wiring.xml could be used for setting up the configuration service.

A *very* important point IMO for the acceptance of all this by
developers is to be able do deploy a directory. This to have fast
roundtrips, without having to go through the compile/package/deploy cycle.

> WDYT?

Looks good!

Sylvain

-- 
Sylvain Wallez
http://bluxte.net
Apache Software Foundation Member

Reply via email to