Hi again...

I uploaded an example on using the component dsl.

https://github.com/csierra/osgi-jaxrs-extracted/pull/8/commits/12f92a61d0e8cd0dbf630a806ac0a31af1ca5934#diff-b7c2953bc9bc598a22c5481f9681e181R120

so this basically tracks every service with a property jaxrs.application.select. For each of those it looks for any CXFJaxRsServiceRegistrator that matches the filter contained in the jaxrs.application.select property of the other service. When it finds a match it registers the endpoint in the registrator.

When any of the dependencies, be it the service or the registrator, goes away it closes the "branches" corresponding to those instances closing the trackers and unreferencing the services. The idea is to build a fairly complete set of "primitives" that allow to operate with services in a safe way trying to avoid leaks as much as possible.

Here https://github.com/csierra/osgi-jaxrs-extracted/pull/8/commits/12f92a61d0e8cd0dbf630a806ac0a31af1ca5934#diff-b7c2953bc9bc598a22c5481f9681e181R103 you can see another snippet. In this case it registers two services in the framework, a Bus and a Servlet. When any of the dependencies goes away the services are unregistered. Together with the "primitives" for configuration you can get something quite similar to STATIC in DS but without the need of any annotation and using the original third party classes.

This is just a first approach. I would like to refine the set of primitives to make them as useful as possible.

One obvious caveat is the horrible syntax. On a bright side, it should be possible to use this from Scala confortably.

Carlos.

El 25/11/16 a las 7:57, Guillaume Nodet escribió:

Thx ! Do you have a few tests / examples that could demonstrate the possibilities of this dsl ?

2016-11-24 18:19 GMT+01:00 Raymond Auge <[email protected] <mailto:[email protected]>>:

    Hello All,

    My very shy colleague Carlos has just added a very nice new
    project in Aries here [1] called "component-dsl"

    It's a functional DSL for OSGi.

    - Ray

    [1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/
    <http://svn.apache.org/repos/asf/aries/trunk/component-dsl/>




--
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: [email protected] <mailto:[email protected]>
Web: http://fusesource.com <http://fusesource.com/>
Blog: http://gnodet.blogspot.com/

Reply via email to