As a former OSGi-buff, I think I need to provide a little bit
guidance/translation here....

What Julian is talking about is how bundles are constructed according to
OSGi, i.e. more stuff in META-INF/MANIFEST.MF, and there is tooling support
to ensure this is done correctly, such as a Maven plugin, Gradle plugin or
bnd/bndtools for Ant. How to package bundles is in the Core Specification.

What Cesar is talking about is that there is an additional Specification
(all supplementary specifications are known as the Compendium[1]) regarding
how hardware drivers should work in the OSGi framework. This is about being
able to create applications that are unaware of the implementations (such
as PLC4X in our case). The first diagram on
http://glcj.blogspot.com/2016/02/merlot-abstract-driver-model-24.html is
taken from the Compendium. Merlot is then Cesar's implementation of the
OSGi "Device Access Specification" for communication with external devices
(not sure the exact scope).

So, Julian is only talking about cases where "I want to use PLC4X in OSGi"
and that requires proper bundling. Cesar is talking about "I want to talk
to external devices via Device Access Specification" and PLC4X could be an
implementation (or part of one) for that. This would in reality require a
sub-project in PLC4X with additional OSGi dependencies and possibly
(depends on many things) some accommodation (typically classloader-related,
and might be needed for Julian's intentions as well) in the PLC4X core
implementation to make that possible.

Needless to say, Julian's suggestion is rather simple and IMHO should put
the metadata inside the regular jars. MOST Apache projects, Spring projects
and endless others, already do this, even though they have no OSGi focus at
all. Cesar's effort is non-trivial and requires a lot of OSGi-expertise,
possibly more than Karaf community is able to provide.

Further, OpenHAB might be (or already is) of interest to PLC4X. OpenHAB
runs on OSGi and it embraces the "implement to Spec" approach of OSGi. I
assume that it leverages the Device Access Specification, and not only do
those folks have plenty of experience with OSGi, they are very comfortable
in the PLC4X space as well, and have a strong community in Germany. I
suggest that a reach-out to them is initiated and see how they could help.
May they will package PLC4X for OSGi to be used on OpenHAB (I think they
use Karaf, but can't remember for sure) and this community won't need to
maintain the hard parts, only the bundlization.


Hope that Helps
Niclas


[1] Other specifications in the Compendium includes things like; JDBC, Http
servers, Configuration management, Declarative Services and much much more.

On Sun, Oct 13, 2019 at 8:11 PM Julian Feinauer <
j.feina...@pragmaticminds.de> wrote:

> Hi all,
>
> with the help of the Karaf Community and especially @Christian Schneider I
> was able to finalize a PR which makes PLC4X fully OSGi-compatible:
> https://github.com/apache/plc4x/pull/89
>
> This means that all jars are also valid (and hopefully correct) OSGi
> Bundles.
> Furthermore, I introduced a Karaf Feature fort he S7 driver (which I
> already tested manually and it works).
>
> Despite some pom additions I had to do a slight refactoring and rename
> several packages to avoid package-split situations.
> Thus, please review my PR carefully (although I consider all of those
> minor).
>
> Thanks!
> Julian
>
> PS.: I think we really should take this into 0.5 release
>
>
> Am 08.10.19, 15:26 schrieb "Christofer Dutz" <christofer.d...@c-ware.de>:
>
>     I agree ... as far as I understand it it's just some text in the
> MANIFEST that doesn't have impact on other class loading systems.
>
>     We should check how we get this additional data in there however.
> There are multiple options and I don't quite know how good all of them are.
>
>     Chris
>
>
>     Am 08.10.19, 10:07 schrieb "Sebastian Rühl"
> <sebastian.ruehl...@googlemail.com.INVALID>:
>
>         Hi Julian,
>
>         We should put the osgi metadata directly into the modules as they
> „just“ enhance the manifest.
>         Additional JARs would only increase the complexity.
>
>         Sebastian
>
>         > Am 07.10.2019 um 15:58 schrieb Julian Feinauer <
> j.feina...@pragmaticminds.de>:
>         >
>         > Hi all,
>         >
>         > as some of you may have notices from Twitter or Slack I am
> currently working on integrating PLC4X into OSGi and especially Karaf.
>         > I get a lot of help from the Karaf guys and also Lukasz joined
> the effort to get this done, finally : )
>         >
>         > For the Drivers, there is one “central” question.
>         > Do we want the Driver jars to also be OSGi-Bundles or do we
> prefer separate jars with a 1-1 relationship as OSGi bundles.
>         > Other projects, like Netty do it all in one (
> https://netty.io/wiki/new-and-noteworthy-in-4.0.html).
>         > In fact, the only difference is a “META-INF/MANIFEST.MF” file
> which is there additionally. So it hurts nobody but helps OSGi users.
>         >
>         > What are your thoughts on that?
>         >
>         > Julian
>
>
>
>
>
>

Reply via email to