You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Clemens Wyss <cl...@mysign.ch> on 2010/12/07 15:22:27 UTC

sling@tomcat : howto communicate with Sling bundles/services?

We are trying to deploy Sling within Tomcat in a project which has a lot of legacy code running in parallel (within the same container). Basically new features/components  shall be implemented in Sling (as bundles). BUT pretty sure we need to build up a "communication channel" between the legacy code and the Sling bundles/services.

Is there a slight chance (given the "protecting" LaunchClassLoader) to get hold of the felix (interface org.osgi.framework.launch.Framework) member within the Sling class?

Any other ideas on how to build up  a "communication channel" without big overhead or leaking classloaders.

Kind regards
Clemens

Re: sling@tomcat : howto communicate with Sling bundles/services?

Posted by Justin Edelson <ju...@justinedelson.com>.
Clemens-
I have no idea if this will work, but you might want to look at the OSGi
JNDI Services specification. It is more orientated around making JNDI
services accessible, but it may be possible to use it to expose an OSGi
service via JNDI outside the OSGi container. Logically, in order to make
this work, the service interfaces will need to be part of the server
classpath and then exported by the system bundle.

Specifically, the bit in the JNDI Services Specification which leads me to
believe this might be in scope is this sentence from the introduction:

"JNDI Provider Model – How JNDI providers can advertise their existence so
they are available to
OSGi and traditional clients"

AFAICT, "traditional clients" would include your other webapps.

Maybe ask about this in a generic way on the Aries mailing list.

Justin

On Tue, Dec 7, 2010 at 9:22 AM, Clemens Wyss <cl...@mysign.ch> wrote:

> We are trying to deploy Sling within Tomcat in a project which has a lot of
> legacy code running in parallel (within the same container). Basically new
> features/components  shall be implemented in Sling (as bundles). BUT pretty
> sure we need to build up a "communication channel" between the legacy code
> and the Sling bundles/services.
>
> Is there a slight chance (given the "protecting" LaunchClassLoader) to get
> hold of the felix (interface org.osgi.framework.launch.Framework) member
> within the Sling class?
>
> Any other ideas on how to build up  a "communication channel" without big
> overhead or leaking classloaders.
>
> Kind regards
> Clemens
>