Re: [osgi-dev] Time to move

2020-12-15 Thread BJ Hargrave via osgi-dev
The osgi-us...@eclipse.org [1] mail list is now set up. No subscriptions have been transferred. So you will need to go there and sign yourself up for the list. See you over on the new list.
 
[1]: https://accounts.eclipse.org/mailing-list/osgi-users
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and OSGi Specification Project lead // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: BJ Hargrave/Austin/IBMTo: osgi-dev@mail.osgi.orgCc:Subject: Time to moveDate: Wed, Dec 9, 2020 15:41 
As part of the mission transfer to the Eclipse Foundation, the osgi.org and mail.osgi.org servers will be soon shutting down.
 
So I have asked Eclipse [1] to provision a new osgi-users mail list to replace this osgi-dev mail list. Once provisioned, the new list [2] should be osgi-us...@eclipse.org.
 
Please look for this new list shortly and subscribe.
 
This is likely the last message from this list as the server is being decommissioned.
 
See you on the other side...
 
[1]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=569608
[2]: https://accounts.eclipse.org/mailing-list/osgi-users
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

[osgi-dev] Time to move

2020-12-09 Thread BJ Hargrave via osgi-dev
As part of the mission transfer to the Eclipse Foundation, the osgi.org and mail.osgi.org servers will be soon shutting down.
 
So I have asked Eclipse [1] to provision a new osgi-users mail list to replace this osgi-dev mail list. Once provisioned, the new list [2] should be osgi-us...@eclipse.org.
 
Please look for this new list shortly and subscribe.
 
This is likely the last message from this list as the server is being decommissioned.
 
See you on the other side...
 
[1]: https://bugs.eclipse.org/bugs/show_bug.cgi?id=569608
[2]: https://accounts.eclipse.org/mailing-list/osgi-users
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] SCR: ServiceInjection into Fields that are Optional

2020-09-28 Thread BJ Hargrave via osgi-dev
I kind of like the idea of Optional for field injection. As Neil says, it is short hand for cardinality=ReferenceCardinality.OPTIONAL.
 
Since R8 supports, Java 8 as the base language level, we can now add support for Optional as a field (and constructor) injection type. Bnd can infer the actual service type from the generic T.
 
So
 
@Reference
Optional foo;
 
would be a static optional reference to a Foo service, The foo field would be injected with either an empty Optional if there is no target Foo service, or a non-empty Optional with the bound Foo service. Like all static references, the foo field would not be changed by SCR during the life cycle of the component instance. This can also be used in constructor injection with a Optional constructor parameter.
 
@Reference
volatile Optional foo;
 
would be a dynamic optional reference to a Foo service. The foo field would be injected with either an empty Optional if there is no target Foo service, or a non-empty Optional with the bound Foo service. Like all dynamic references, the value of the foo field can be changed by SCR at any time during the life cycle of the component instance. So when the component wishes to use the field, it should copy the field's value into a local variable before inspection and use.
 
Optional localFoo = foo;
if (localFoo.isPresent()) { do something with localFoo; }
 
I do not think Promise is a proper type to use here. Promise is about a future result and is a one-time latch on resolving the value. At the time SCR will inject the field, the state of the target service must be known. For dynamic references, SCR must replace the field as the bound service changes. So there is no real utility in using Promise here as you still would have know way to know there was a new Promise object to which you might want to attach a callback.
 
I will open an issue to add Optional support for field and constructor injection to DS 1.5 for R8.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mark Hoffmann via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: Neil Bartlett Cc: OSGi Developer Mail List Subject: [EXTERNAL] Re: [osgi-dev] SCR: ServiceInjection into Fields that are OptionalDate: Wed, Sep 23, 2020 10:14    

 

Hi Neil,
 
exactly I thought of a fluent API for a ServiceTracker.
 
Regards,
 
Mark Hoffmann 
M.A. Dipl.-Betriebswirt (FH) 
CEO/CTO 
 
Phone: +49 3641 384 910 0 
Mobile: +49 175 701 2201 
E-Mail: m.hoffm...@data-in-motion.biz 
 
Web: www.datainmotion.de 
 
Data In Motion Consulting GmbH 
Kahlaische Strasse 4 
07745 Jena 
Germany 
 
Geschäftsführer/CEO 
Mark Hoffmann 
Jürgen Albert 
 
Jena HRB 513025 
Steuernummer 162/107/05779 
USt-Id DE310002614
 
 
 Ursprüngliche Nachricht 
Von: Neil Bartlett 
Datum: 23.09.20 16:01 (GMT+01:00)
An: Mark Hoffmann 
Cc: OSGi Developer Mail List 
Betreff: Re: [osgi-dev] SCR: ServiceInjection into Fields that are Optional
 
Ah okay thank you. So you're not talking about the existing Promise class, rather a class that would keep track of the changing state of the service.
 
As I think you said, that's basically a ServiceTracker. However the existing ServiceTracker class has a lot of complexity and still uses ancient APIs like Dictionary. So the requirement could be to define a new interface ("ServiceHandle"?) that has methods like:
 
    interface ServiceHandle {
        void ifPresent(Consumer); // from Optional
        Stream stream(); // from Optional
        Promise whenResolved();
        Promise whenUnresolved();
    }
 
SCR could inject an instance of this interface into a component (component authors would not be able to instantiate their own instance).
 
It's an interesting idea, but I believe it would be better to keep it as a separate requirement from the "support Optional-typed field injection" requirement.
 
Neil


On Wed, 23 Sep 2020 at 14:24, Mark Hoffmann  wrote:
Hi Neil,
 
thus is why I said something like a Promise. I think in my first post this morning I mentioned e.g. the missing unresolve or reresolve.
 
On the other side, if we had such an special Object, we could also bring the feature of callbacks back to field injection.
 
Just to get you right, I am not against the idea, I just wanted to get a step further !? 
 
 
Mark Hoffmann 
M.A. Dipl.-Betriebswirt (FH) 
CEO/CTO 
 
Phone: +49 3641 384 910 0 
Mobile: +49 175 701 2201 
E-Mail: m.hoffm...@data-in-motion.biz 
 
Web: www.datainmotion.de 
 
Data In Motion Consulting GmbH 
Kahlaische Strasse 4 
07745 Jena 
Germany 
 
Geschäftsführer/CEO 
Mark Hoffmann 
Jürgen Albert 
 
Jena HRB 513025 
Steuernummer 162/107/05779 
USt-Id DE310002614
 
 
 Ursprüngliche Nachricht 
Von: Neil Bartlett 
Datum: 23.09.20 13:14 (GMT+01:00)
An: Mark Hoffmann 
Cc: OSGi 

[osgi-dev] ANNOUNCE: osgi-test 0.9.0 has been released

2020-06-30 Thread BJ Hargrave via osgi-dev
An open source project for OSGi testing [1] has been working on better support for testing in OSGi environments. We are pleased to announce a first release [2]. Part of the work in this project was to help the AssertJ and JUnit 5 projects make better bundles for use in testing in OSGi environments and the latest releases of those projects are fully ready for OSGi testing. The latest Bnd has a biz.aQute.tester.junit-platform bundle which drives JUnit Platform based testing under Bnd.
 
The osgi-test project adds custom AssertJ assertions for some OSGi types and adds JUnit 4 Rules and JUnit 5 Extensions to make testing in OSGi easier.
 
I just recently integrated all of this into the OSGi Compliance Tests for the upcoming OSGi Release 8 and it works great.
 
Please try out the project and provide feedback and pull requests to make it better!
 
[1]: https://github.com/osgi/osgi-test
[2]: https://github.com/osgi/osgi-test/wiki/Release-Notes-0.9.0
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] R8 draft spec?

2020-06-03 Thread BJ Hargrave via osgi-dev
I thought Core R8 draft was already at https://www.osgi.org/developer/specifications/drafts/ but it was not. So I put it there.
 
We are looking to finalize technical work on Core R8 this month. Publication will be 2 months or so later.
 
I don't have dates to share on Compendium R8.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Scott Lewis via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [EXTERNAL] [osgi-dev] R8 draft spec?Date: Wed, Jun 3, 2020 14:02 
I didn't find the R8 spec draft onwww.osgi.org/developer/specifications.  Is the R8 draft availablepublicly somewhere?  If so, where?Also...what is the anticipated schedule for R8 spec release (framework,compendium, etc if different)?Thanks,Scott___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] (no subject)

2020-04-14 Thread BJ Hargrave via osgi-dev
You can of course infer the proper names for osgi.ee names for al recent Java SE releases. The list on the web page may be behind. See https://github.com/bndtools/bnd/blob/master/biz.aQute.bndlib/src/aQute/bnd/build/model/EE.java for the latest list in Bnd.
 
OSGi is no longer making execution environment jars. The need for that has passed with the end of J2ME and the need for an intersection of J2ME CDC and Java SE.
 
I am not sure what you mean by a best practice of using post Java 9 runtimes with OSGi. Just use them in normal classpath mode. You will probably need a recent version of you favorite OSGi framework implementation to make sure it runs well on the recent versions of Java SE.
 
Equinox is still the OSGi framework RI. It is released every 3 months are part of the current Eclipse release cadence.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Peter Kirschner via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: "osgi-dev@mail.osgi.org" Cc:Subject: [EXTERNAL] [osgi-dev] (no subject)Date: Tue, Apr 14, 2020 06:12 
Hi everybody, 
I have a few questions  about the future handling of JRE topics with OSGi
 
1. Will there be updates on the osgi.ee capability/profile for the Bundle-RequiredExecution environment.
The latest profile available is JavaSE-9 https://www.osgi.org/developer/specifications/reference/
In the past there were ee.j2se profiles, which I found brilliant to have a JRE capability set. Due to the JRE legal issues this was not feasible in between. With current open jdk it would be again possible and allow to have a complete req/cap resolvement.
 
2. Is there an official guide or best-practice, how to use post java 9 runtimes with OSGi frameworks? 
 
3. Is Equinox still the reference implementation? When is an update planned?
https://download.eclipse.org/equinox/drops/S-4.16M1-202004090200/download.php?dropFile=org.eclipse.osgi_3.15.300.v20200401-2046.jar
 
kind regards,
 
Peter
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Problem during bundle release: unresolved requirement

2020-03-31 Thread BJ Hargrave via osgi-dev
Your bundle needs to import the PubNub API package which means some other bundle must export the package. So you need to find or make a bundle which exports the PubNub API.
 
Note: The PubNub code may not work properly in an OSGi environment if it make certain assumptions about the class loading environment. So you may need knowledge of how the PubNub code works to properly make a bundle for it since you may need to write some small amount of code or properly craft the bundle manifest.
 
Good luck!
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alessandro Verga via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [EXTERNAL] [osgi-dev] Problem during bundle release: unresolved requirementDate: Tue, Mar 31, 2020 10:23 
Good evening,
i am developing a bundle for Eclipse Smarthome (a binding for the OpenHAB runtime to be precise) but i have encountered a problem during the release of the bundle. 
i have already googled and mailed OpenHAB days ago, but i haven't find an answer. 
 
i have imported a non-OSGi library ( PubNub, a realtime database with functions of publish/subscribe ) through both a line in my pom.xml and feature.xml files.
the bundle builds and compiles correctly (through running 'maven clean install').
 
I would like to point out this is not a library problem, as i am using the same library, with the same dependencies, in another local java project, and it is working. 
The problem seems to be related to OpenHAB, or OSGi, so that is why i am mailing this to you and not to PubNub dev support. I am sorry if it turns out this isn't a problem of your competence and i am wasting your time. 
 
 
Anyway,
From the karaf console when i run bundles:list i see my bundle as Installed, not as Active. 
When i run "restart [id]" it displays the following error: 
 
Unresolved requirement: Import-Package: com.pubnub.api
 
a "resolve [id]" command does not yield anything visible.
 
In my pom.xml i included this dependency:
 groupid: com.pubnub
 artifactid: pubnub-gson
 version: 4.31.0
 scope: provided
 
As per PubNub official documentation (source here https://www.pubnub.com/docs/java-se-java/pubnub-java-sdk ) this is the only dependency i need to add, so the required might be a transitive dependency. 
 
This is the feature.xml line i have added, following OpenHAB official documentation ( source here https://www.openhab.org/docs/developer/buildsystem.html ) : 
 feature: openhab-runtime-base
 feature prerequisite="true": wrap
bundle dependency="true": wrap:mvn:com.pubnub/pubnub-gson/4.31.0
 
I suppose i should provide some jar files to my bundle root or to my local maven .m2 folder, but i do not know which jar file and where to find it. 
PubNub has a general .jar file indicated in the documentation page above but i suppose Maven included it through my pom's dependency. 
 
 
Thank you for your time,
hoping you can help me. 
 
Alessandro
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Service binding issue and package wiring

2020-03-11 Thread BJ Hargrave via osgi-dev
If multiple bundles export the identical package (that is, the same class files containing the same byte codes), the runtime classes are different and distinct. A Class object is a product of the class file and the class loader which loads it.
 
So when bundle B (exporting its copy of package api.a) loads api.a.Service1 and bundle C (exporting its copy of package api.a) loads api.a.Service1, those are two different classes as far as the JVM is concerned.
 
Note, when a bundle both exports and imports a package, the framework is free to resolve the bundle in either state: exporting or importing. So when multiple bundles both export and import a given package, it is entirely possible the framework may choose that more then one of the bundles export the package. Ideally, we would want the framework to select only a single bundle to export the package and that all other bundles import the package. But there can be many reasons (such as other class space constraints) which may cause the framework to export the package from multiple bundles.
 
I would recommend you have a API bundle which exports api.a which is usable at runtime and that all implementation bundles import api.a.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Clément Delgrange via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [EXTERNAL] Re: [osgi-dev] Service binding issue and package wiringDate: Wed, Mar 11, 2020 10:58 
> Since both bundles B and C offer to export the api.a package, the framework could resolve both bundles to each export the package. Thus you can end up with 2 exports of the api.a package in the framework. So bundle D will import api.a from either bundle B or bundle C and thus will not be able to see the service from the other bundle since it is not type compatible.
 
Maybe I lack some basic knowledge about Java class loading, but I thought that as the packages were at the same version there was nothing that can really distinguish them, the framework will choose to use one of the packages from a specific location (eg; Bundle B) and so the services could not be impacted by a type compatibility issue. This is what I understand from the blog post sent by Ray too: "Because the OSGi framework controls the classloading on the package level, when multiple bundles export the API package(s), the OSGi framework can decide which exporting bundle ultimately provides the API package(s) to each bundle importing the API, that is, to each API consumer.". But as I can factually see and from your explanation things can happen differently?!
 
> You may want to also look at https://blog.osgi.org/2020/01/to-embed-or-not-to-embed-your-api.html
 
Thanks for the link. In the section Going Forward, it is wrote that we should consider not embedding API packages that are defined by OSGi specifications, does this advice also holds for our own service definitions?
 
When building a system with multiple related features does it makes sens to provide a compile time Bundle with all the API packages, and, one runtime API Bundle for each API packages? Is it what the blog post is telling us? What is the relation between osgi.cmpn and the set of osgi runtime API bundles?
 
I like to have one API bundle per workspace, it makes dependency management easier and I have one unique project to be careful with. Would it be relevant that bnd/bndtools provides a support to release multiple runtime API Bundles from one API project simply by configuring something in the bnd.bnd file. I am not sure to be clear, but this is to control the number of projects needed.
 
Another solution would be to make the API Bundle resolvable, but I had some issue with that in the past...
 
 
 
‐‐‐ Original Message ‐‐‐
On Wednesday 11 March 2020 14:19, Raymond Auge  wrote:
 
Hi Clément,
 
You may want to also look at https://blog.osgi.org/2020/01/to-embed-or-not-to-embed-your-api.html
 
:)
 
- Ray
 
On Wed, Mar 11, 2020 at 9:16 AM BJ Hargrave via osgi-dev <osgi-dev@mail.osgi.org> wrote:
Since both bundles B and C offer to export the api.a package, the framework could resolve both bundles to each export the package. Thus you can end up with 2 exports of the api.a package in the framework. So bundle D will import api.a from either bundle B or bundle C and thus will not be able to see the service from the other bundle since it is not type compatible.
 
In this scenario, it is better to have only a single exporter of api.a. Bundle A would be the best choice here as it is the original source of the package. But you would need to allow it to be resolvable so it can be used at runtime.
--
 
BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
 
 
- Origi

Re: [osgi-dev] Service binding issue and package wiring

2020-03-11 Thread BJ Hargrave via osgi-dev
Since both bundles B and C offer to export the api.a package, the framework could resolve both bundles to each export the package. Thus you can end up with 2 exports of the api.a package in the framework. So bundle D will import api.a from either bundle B or bundle C and thus will not be able to see the service from the other bundle since it is not type compatible.
 
In this scenario, it is better to have only a single exporter of api.a. Bundle A would be the best choice here as it is the original source of the package. But you would need to allow it to be resolvable so it can be used at runtime.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Clément Delgrange via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [EXTERNAL] [osgi-dev] Service binding issue and package wiringDate: Wed, Mar 11, 2020 08:13 
Hi all,
 
I have some sparse service binding issues at runtime that I think are related at how my bundles export packages.
 
Here is what I have:
- Bundle A exports API package api.a and is not resolvable (not present at runtime).
- Bundle B provides api.a.Service1 service and export/import  api.a package.
- Bundle C provides api.a.Service2 service and export/import  api.a package.
- Bundle D consumes Service1 or Service2 and import api.a package.
 
In this case is there any reason related to the way packages are wired that could lead bundle D to not get Service1 or Service2? Subsidiary question, is it fine to have an API package partly provided by two different bundles when provider bundles embed their API?
 
In a more general practice, for a specific functionality, I have often one core service contract, some DTOs and some DAO services. Which one of this combination is better (considering that I have always an unresolvable API bundle and my providers export the API package they provide):
 
- Core service, DAOs and DTOs in one API package then two providers, one for the core service implementation and DTOs and the other for the DAOs implementation.
- Core service, DAOs and DTOs split in different API packages then three providers, one for each.
 
Regards,
Clement
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] escaping registry filter queries

2019-12-10 Thread BJ Hargrave via osgi-dev
If you are using an API which takes a filter _expression_, the filter _expression_ must be well formed. This can include escaping any characters which would otherwise be interpreted as part of the _expression_ language.
 
The spec, https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module.filtersyntax, is pretty clear on this:
 
"attr must not contain the characters '=', '>', '<', '~', '(' or ')'."
 
"If value must contain one of the characters reverse solidus ('\' \u005C), asterisk ('*' \u002A), parentheses open ('(' \u0028) or parentheses close (')' \u0029), then these characters should be preceded with the reverse solidus ('\' \u005C) character."
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Leschke, Scott via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: "'osgi-dev@mail.osgi.org'" Cc:Subject: [EXTERNAL] [osgi-dev] escaping registry filter queriesDate: Tue, Dec 10, 2019 13:06  
I’d like to know which characters need to be escaped in registry queries. Obviously characters ‘(‘ and ‘)’ need to be, and the escape character ‘\’ itself.
So what others, ‘=’, ‘<’ and ‘>’ perhaps?  The negation ‘!’ char?
 
Since filters use LDAP syntax, I had assumed that the escaping would follow LDAP rules as well, ie ‘(‘ -> “\28” and ‘)’ -> “\29” but that doesn’t appear to work at all.
 
As always, thanks in advance.
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] IoT and UPnP protocol

2019-11-25 Thread BJ Hargrave via osgi-dev
You can look here https://en.wikipedia.org/wiki/OSGi_Specification_Implementations
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Clément Delgrange via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [EXTERNAL] [osgi-dev] IoT and UPnP protocolDate: Mon, Nov 25, 2019 05:47 
Hi all,
 
Is there an open source implementation of the UPnP specification that works well and is up-to-date? I found this http://felix.apache.org/documentation/subprojects/apache-felix-upnp.html but there are maybe more documented alternatives...
 
Thanks,
Clément.
 
 
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] @ConsumerType vs @ProviderType

2019-10-16 Thread BJ Hargrave via osgi-dev
Nailed it!
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Raymond Auge via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: Milen Dyankov via osgi-dev Cc:Subject: [EXTERNAL] Re: [osgi-dev] @ConsumerType vs @ProviderTypeDate: Wed, Oct 16, 2019 19:06 
Let me see if I can take a crack at it! Though I'm often told I also don't understand when I try to explain it. :D
 
Suppose you have an API like so:
 
interface DataHandler {
 void processData(DataContext context);
}
 
This API has 2 interfaces `DataHandler` and `DataContext`
 
Now you happen to know there is a library data.machine-1.2.3.jar which is a data processing engine and to use it all you need to do is publish an OSGi service of type `DataHandler` and it will do some magic. 
Since you implement `DataHandler` this interface is sensitive to you as a consumer. If the API were to add a method if would break your code. In this case DataHandler is effectively @ConsumerType. It is a type which is implemented in order to _use_ the API.
 
Now, DataContext is not so sensitive for you in this scenario because you only _recieve_ instances of it. You never have to implement it in your _use_ of the API. In this case DataContext is @ProviderType since it's an interface which only _providers_ implement. Therefore if a new method was added to it, it would _not_ break your code, it _would_ however force the implementers of data.machine-1.2.3.jar to make a new release since they are a _provider_ of the API.
 
So you see, both interfaces are part of the same API, yet one is @ConsumerType (DataHandler) and the other is @ProviderType (DataContext).
 
I hope that helps. Others feel free to correct my understanding and hopefully, I'll finally grok it myself.
- Ray
  

On Wed, Oct 16, 2019 at 3:34 PM Milen Dyankov via osgi-dev  wrote:
Welcome to the club ;) I struggled with that myself for a long time. 
 
I think I finally got to understand it couple of years ago. Here is how I explained it during one of my talks: https://www.youtube.com/watch?v=hGNrZmr0zz8=youtu.be=1569
I hope this helps better than me trying to write it all down here.
 
Best,
Milen 

On Wed, Oct 16, 2019 at 9:15 PM Leschke, Scott via osgi-dev  wrote:
I’m trying to wrap my head around these two annotations and I’m struggling a bit. Is the perspective of the provider and consumer roles from a bundle perspective or an application perspective?
I’ve read the Semantic Versioning whitepaper a number of times and it doesn’t really clear things up for me definitely.
 
If an application has an API bundle that only exposes Interfaces and Abstract classes, and those interfaces are implemented by other bundles in the app, are those bundles providers or consumers? My inclination is that they’re providers but then when does a bundle become a consumer?  Given that API bundles are compile only (this is the rule right?), would a good rule be that if you implement the interface and export the package it’s in, that type would be @ProviderType, if you don’t implement it it’s @ConsumeType?
 
It would seem to me that @ProviderType would be the default using this logic, as opposed to @ConsumerType, which leads me to believe that I’m thinking about this wrong.
 
Any help appreciated as always.
 
Regards,
 
Scott Leschke___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 

 --

http://about.me/milen___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev--
Raymond Augé (@rotty3000)
Senior Software Architect Liferay, Inc. (@Liferay)
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Configurator resources that depend on a ConfigurationPlugin

2019-10-08 Thread BJ Hargrave via osgi-dev
Configuration Plugins mutate configuration data each time it is delivered to a configuration target. So the Configuration Plugin must be active before any configuration targets which care about the mutated configuration data.
 
So this is orthogonal to Configurator which is about putting configuration data in the CM configuration data store.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Clément Delgrange via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [EXTERNAL] [osgi-dev] Configurator resources that depend on a ConfigurationPluginDate: Tue, Oct 8, 2019 06:08 
Hi all,
 
I have a question regarding the Configurator and the ConfigurationPlugin spec. I would like to provision my application with configurations as I do with my the bundles, for this the Configurator seems perfect. But, the values inside my configurations could be different depending of the environment (dev, beta, prod, ...) and my configurations may contain sensitive data that I don't want in my Git repo. In this case I think I could provide a ConfigurationPlugin which will replace placeholders with data coming from a database.
 
My question is, how can I tell to the Configurator bundle to not process resources that contains placeholder until my ConfigurationPlugin is up?
 
Thanks,
 
Clément Delgrange.
 
 
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Shutdown order

2019-08-12 Thread BJ Hargrave via osgi-dev
Perhaps platform depends upon something which is no longer active?
 
Since these exceptions seem to be from Eclipse plugins, perhaps Eclipse people can be of more specific help here?
 
From the spec point of view, bundles in higher start levels are stopped before bundles at lower start levels. I would assume that the Equinox framework is correct here. So the issue would be in the Eclipse bundles.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alain Picard via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [EXTERNAL] [osgi-dev] Shutdown orderDate: Sat, Aug 10, 2019 08:13 
Hi,
 
I'm getting some exceptions when invoking shutdown. Some of those come from Eclipse plugins that expect the Platform to exist (from o.e.core.runtime).
 
I was reading section 9.3.1 and expected that if o.e.core.runtime start level would be lower then it would be stopped later in the process as the level is decremented by 1. This didn't stop the exception (similar to what was reported here).
 
What am I missing? Or what can I do.
 
Cheers,
Alain
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] ConfigAdmin and DS Component Factory

2019-08-07 Thread BJ Hargrave via osgi-dev
Factory configurations (in ConfigAdmin) and ComponentFactory (in DS) do not work together. They are mutually exclusive There can be only one thing in charge of making multiple instances of a component.
 
It can be either factory configurations (in ConfigAdmin), in which case a component instance is made for each configuration, or ComponentFactory (in DS), in which case a component instance is made for each call to ComponentFactory.newInstance().
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Michael Lipp via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [EXTERNAL] [osgi-dev] ConfigAdmin and DS Component FactoryDate: Wed, Aug 7, 2019 11:58 
Hi,trying to create DS instances from ConfigAdmin Configurations, I cameacross this postinghttps://mail.osgi.org/pipermail/osgi-dev/2010-March/002398.html . As theposting is from 2010, I'd just like to make sure: can somebody pleaseconfirm that this is still true for the current version of DS?Thanks! - Michael___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Conditional Target

2019-06-26 Thread BJ Hargrave via osgi-dev
The RFC includes adding support to DS (and CDI) but is service based and can be used in any service model. The RFC also includes configuration based support for creation of Conditions which is useful.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Peter Kriens To: BJ Hargrave Cc: via bndtools-users , osgi-dev@mail.osgi.orgSubject: [EXTERNAL] Re: [osgi-dev] Conditional TargetDate: Wed, Jun 26, 2019 10:27 I was vaguely aware of this RFC but that is an extension to the DS Components isn't it? That will have more capabilities I assume since you're not restricted to the features of the current spec. 
 
This is basically a continuance of the aggregate service but with a bit smaller scope. The Aggregate Service had some basic limitations because not all components shared the same view at the same time.
 
It is a tricky area.
 
I read the RFC in detail. Kind regards,
 
Peter Kriens
 
 
 
On 26 Jun 2019, at 14:29, BJ Hargrave <hargr...@us.ibm.com> wrote: 

This seems just like https://github.com/osgi/design/blob/master/rfcs/rfc0242/rfc-0242-Condition-Service.pdf
 
Are you making an alternate design? Or did you not know of this RFC?
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Peter Kriens via osgi-dev <osgi-dev@mail.osgi.org>Sent by: osgi-dev-boun...@mail.osgi.orgTo: via bndtools-users <bndtools-us...@googlegroups.com>, osgi-dev@mail.osgi.orgCc:Subject: [EXTERNAL] [osgi-dev] Conditional TargetDate: Wed, Jun 26, 2019 08:26 I've developed a service that you can use to block the activation of a DS component until a set of other services are ready. This is related to the whiteboard pattern when the sender wants to be sure a certain set of whiteboard services are present. Normally you can only assert the properties of 1 service but this allows you to use a filter to select the aggregated properties of a group of services. An example is when you need a set of at least 3 remote services where there are at least 2 unique regions. 
 
For example, you want to block until the average of the `foo` properties on the registered Foo services is higher than 2:
 
@Reference( target="([avg]foo>=2)" )
ConditionalTarget foos;
 
The Conditional Target object provides a direct reference to the services and service references being tracked as well as the aggregated properties. 
 
It is described in 
 
https://github.com/aQute-os/biz.aQute.osgi.util/tree/master/biz.aQute.osgi.conditionaltarget
 
And you can find the binary artifact in:
 
https://oss.sonatype.org/content/repositories/snapshots/biz/aQute/biz.aQute.osgi.conditionaltarget/
 
Feedback appreciated on the idea and execution. If people like this, I can submit it to Apache Felix if they're interested.
 
Kind regards,
 
Peter Kriens
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Conditional Target

2019-06-26 Thread BJ Hargrave via osgi-dev
This seems just like https://github.com/osgi/design/blob/master/rfcs/rfc0242/rfc-0242-Condition-Service.pdf
 
Are you making an alternate design? Or did you not know of this RFC?
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Peter Kriens via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: via bndtools-users , osgi-dev@mail.osgi.orgCc:Subject: [EXTERNAL] [osgi-dev] Conditional TargetDate: Wed, Jun 26, 2019 08:26 I've developed a service that you can use to block the activation of a DS component until a set of other services are ready. This is related to the whiteboard pattern when the sender wants to be sure a certain set of whiteboard services are present. Normally you can only assert the properties of 1 service but this allows you to use a filter to select the aggregated properties of a group of services. An example is when you need a set of at least 3 remote services where there are at least 2 unique regions. 
 
For example, you want to block until the average of the `foo` properties on the registered Foo services is higher than 2:
 
@Reference( target="([avg]foo>=2)" )
ConditionalTarget foos;
 
The Conditional Target object provides a direct reference to the services and service references being tracked as well as the aggregated properties. 
 
It is described in 
 
https://github.com/aQute-os/biz.aQute.osgi.util/tree/master/biz.aQute.osgi.conditionaltarget
 
And you can find the binary artifact in:
 
https://oss.sonatype.org/content/repositories/snapshots/biz/aQute/biz.aQute.osgi.conditionaltarget/
 
Feedback appreciated on the idea and execution. If people like this, I can submit it to Apache Felix if they're interested.
 
Kind regards,
 
Peter Kriens
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Using Gradle or Maven on a new OSGi project

2019-06-25 Thread BJ Hargrave via osgi-dev
Bnd supports Gradle and Maven. So you can use Gradle if you prefer (I personally prefer Gradle.)
 
OSGi enRoute is now using Maven since it is, by far, much more popular than Gradle. But a Gradle variant of enRoute could also be made. But it is more work to dual maintain the variants. So with limited resources, we chose Maven for enRoute. But that does not mean Maven is preferred over Gradle.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Stephen Schaub via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [EXTERNAL] [osgi-dev] Using Gradle or Maven on a new OSGi projectDate: Mon, Jun 24, 2019 16:28 
I'm new to OSGi and am starting a project. I found the enRoute material and noticed that the enRoute tutorials apparently at one time utilized Gradle as the build tool, but are now using Maven. 
 
I'm more familiar with Gradle and have worked out how to use Gradle to do what I need for the project, but I was wondering 1) why the switch from Gradle to Maven for enRoute and 2) is Maven the preferred build tool for OSGi going forward? Is there a reason I should consider switching to Maven?
 
I've poked through the mailing list archives trying to find answers to these questions but can't seem to find a record of any discussions about this, so am hoping someone can shed some light for me.
 --

Stephen Schaub
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Micro version ignored when resolving, rationale?

2019-06-18 Thread BJ Hargrave via osgi-dev
Michael,
 
Can we please step back to the beginning and describe, in much more detail, the issue you are seeing? I never understood the actual issue you seemed to be having.
 
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Michael Lipp via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: Neil Bartlett , OSGi Developer Mail List Cc:Subject: [EXTERNAL] Re: [osgi-dev] Micro version ignored when resolving, rationale?Date: Tue, Jun 18, 2019 09:33 
 

As for why bnd makes this implementation choice, bear in mind that import ranges are applied to packages, which in a pure and ideal world would contain only interfaces and perhaps DTOs, but no implementation code. What kind of "bugs" could we be talking about in such a package, other than documentation? Of course the world is not always pure and ideal which is why the default can be overridden.
But in the real world, every project imports "OSGi-fied" libraries, usually several, and they have bugs and (hopefully) fixes. So it is something to be considered. What good is a tool that works in an ideal world if you need something done in the real world.
 - Michael
 
Neil
 
  

On Tue, 18 Jun 2019 at 09:54, Michael Lipp via osgi-dev  wrote:
 
Considering this, lowering a lower bound of an Import-Package statement when resolving should be acknowledged as a bug. 
I beg to differ ...
As said, you can set the consumer/provider policy to your desired strategy.
So having default settings in the tool that cause a behavior that does not comply with the specification should not be considered a bug?
 - Michael
 
 
Kind regards,
 
Peter Kriens
 
On 18 Jun 2019, at 10:33, Michael Lipp  wrote: 

 
 
I expect there are two things at play. First, OSGi specifies things as you indicate. An import of [1.2.3.qualifier,2) must not select anything lower than 1.2.3.qualifier. Second, bnd does have heuristics that do drop the qualifier and micro part in calculating the import ranges from the exports on the class path.
Thanks for the clarification, I think this explains things.
[...]
 Conclusion, the spec is perfect but the implementations apply heuristics and may have bugs.
The specification says (or defines, if you like): "micro - A change that does not affect the API, for example, a typo in a comment or a bug fix in an implementation." It explicitly invites the developer to indicate a bug fix by incrementing the micro part. There's no hint or requirement that he should increment the minor part to reflect a bug fix. I do not find your statement "The definition of the micro version is that it should not make a difference in runtime" to be supported by the spec or the Semantic Versioning Whitepaper. Actually, this interpretation would restrict the usage of the micro part to documentation changes because every bug fix changes the runtime behavior. This is, after all, what it is intended to do.
Considering this, lowering a lower bound of an Import-Package statement when resolving should be acknowledged as a bug.
 - Michael
 
 
Kind regards,
 
Peter Kriens
 
On 17 Jun 2019, at 12:14, Michael Lipp via osgi-dev  wrote: 

Hi,I have in my repository a bundle A-2.0.1 that exports packages withversion 2.0.1 and a bundle A-2.0.3 that exports these packages withversion 2.0.3. Version A-2.0.3 fixes a bug.I have a bundle B that imports the packages from A with importstatements "... version=[2.0.3,3)" because the bug fix is crucial forthe proper working of B.Clicking on "Resolve" in bndtools, I get a resolution with bundleA-2.0.1. I understand that this complies with the specification ("It isrecommended to ignore the micro part of the version because systems tendto become very rigid if they require the latest bug fix to be deployedall the time.").What I don't understand is the rationale. I don't see any drawbacks indeploying the latest bug fix. Of course, there's always the risk ofintroducing a new bug with a new version, even if it is supposed to onlyfix a bug in the previous version. But if you're afraid of this, you mayalso not allow imports with version ranges such as "[1.0,2)" (forconsumers).In my case, I now have to distribute bundle B with a release note toconfigure the resolution in such a way that only A 2.0.3 and up is used.Something that you would expect to happen automatically looking at theimport statement. And if I want to make sure that the release note isnot overlooked, the only way seems to be to check the version of "A" atrun-time in the activation of "B". This is downright ugly. - Michael___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 
 ___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

Re: [osgi-dev] Migrating from OSGI to Microservices

2019-05-02 Thread BJ Hargrave via osgi-dev
With OSGi's JAX-RS support [1], you can easily publish and consume RESTy endpoints in your OSGi application.
 
So there is no need to "leave" OSGi to participate in a microservice environment.
 
[1]: https://osgi.org/specification/osgi.enterprise/7.0.0/service.jaxrs.html
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Neil Bartlett via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: Mohamed AFIF , OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Migrating from OSGI to MicroservicesDate: Thu, May 2, 2019 6:37 AM 
Well the good news is that OSGi is already a microservice architecture, so you have already finished. Congratulations!
 
If that answer doesn't quite satisfy you, maybe you'd like to describe in more detail what you are attempting to achieve and why?
 
Regards,
Neil 

On Thu, 2 May 2019 at 11:06, Mohamed AFIF via osgi-dev  wrote:
Hello everybody,
 
We 're starting to study the possibility to transform our architcteure in order to migrate from OSGI to microservice architecture, and I would like to know if there is alreay some people who had thought about this subject or already start this migration.
Because at first sight it would not be an easy task, many problems/issues we will be facing to them (blueprint injections, managing ditrubued caches instead of one cache in one JVM...)
 
Many thanks
 
 
 --

 
Cdt
Mohamed AFIF___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] SCR API

2019-02-26 Thread BJ Hargrave via osgi-dev
quot;:
1) "Old school Services": I usually register those programmatically via context.registerService(...). Those services are just POJOs with a little bit metadata, i.e., properties, and a well-defined interface. Those I will call services for the rest of this mail.
2) "Fancy services" aka DS managed by a SCR. I specify those declaratively via annotations, they have a lifecycle and can have references to other services/components via annotations like @Activate/@Deactivate (Lifecycle) and @Reference. Those I will call components for the rest of this mail.
 
The difference between both (as far as I understand it) is that services can be instantiated and registered programmatically, but are not managed by SCR and therefore have no references and lifecycle methods. 
 
Components on the other side have references and lifecycle methods, but in order to instantiate them programmatically I have to force a developer to annotate the class with @Component(scope=ServiceScope.PROTOTYPE) and then use ServiceObjects#getService() to instantiate/register it.
 
This procedure can be error-prone, e.g., when I assume that scope is always PROTOTYPE but the developer forgot to set it to this value. This problem came up during my discussion with Vaadin for a Flow-OSGi integration.
 
In this context it would be great if there were a possibility to programmatically create components (not services) where I can tell SCR what fields/methods have to be treated as @Reference or lifecycle methods and let SCR do the heavy lifting. 
In Flow this would enable me to easily instantiate all classes that are annotated with Vaadin's @Route annotation and register them as components with scope PROTOTYPE and also to encorporate stuff like references and lifecycle methods with my own annotations. 
 
So for a class that looks like this:
 
@Route("")
public class MainView extends VerticalLayout{
  @OSGiRef
  SomeService someService;
}
 
I could call some imaginary API like this:
 
scr.createCmp(MainView.class)
     .setScope(PROTOTYPE)
     .setService(HasElement.class)
     .addReference(someService);
 
and SCR would create this comopnent at runtime, inject the service someService and then return this instance so that a third-party lib can interact with it, while SCR still controls the lifecycle and coming/going of referenced services/components.
 
Would such an API make sense? Or would it even be possible?
 
I think in general this would be very useful in order to create OSGi integrations for third-party libs that need to interact with DS in OSGi. 
 
 
I hope this clarified my former email.
 
Kind regards,
Thomas
 
 
 
-- Originalnachricht --
Von: "BJ Hargrave" <hargr...@us.ibm.com>
An: thomas.driessen...@gmail.com
Gesendet: 21.02.2019 14:48:18
Betreff: Re: Re[2]: [osgi-dev] SCR API
 
I am not what you mean by a "possiblity to register services in a way to get references injected at runtime". Those are the different sides of a service: The provider of the service and the consumers of a service. Each side can use different models to interact. One can register with the service API and the other can consume with DS, CDI, etc. So service consumers do not need to care how the service provider is implemented. So you can used DS to @Reference services which have been registered by any method.
 
Because everything is a service in the framework's service registry, each side of the service interaction can be written using different models.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Thomas Driessen" <thomas.driessen...@gmail.com>To: "BJ Hargrave" <hargr...@us.ibm.com>Cc:Subject: Re[2]: [osgi-dev] SCR APIDate: Thu, Feb 21, 2019 7:37 AM 
Hi BJ,
 
is there a possiblity to register services in a way to get references injected at runtime, i.e., something like the @Reference funtionality but for services registered programmatically?
 
I think this would be a great enhancement for third-partyy libraries who want to plug in into OSGi's DI framework.
 
Kind regards,
Thomas
 
-- Originalnachricht --
Von: "BJ Hargrave" <hargr...@us.ibm.com>
An: thomas.driessen...@gmail.com; osgi-dev@mail.osgi.org
Cc: osgi-dev@mail.osgi.org
Gesendet: 21.02.2019 13:21:06
Betreff: Re: [osgi-dev] SCR API
 
There is not plan for Declarative Services to have an API for imperatively creating components/services. The whole point of Declarative Services is the declarative nature of it. You can always use the service APIs of the framework to create services. Or something like felix dependency manager.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Thomas Driessen via osgi-dev

Re: [osgi-dev] Mave archetype repository not reachable

2019-02-26 Thread BJ Hargrave via osgi-dev
See https://github.com/osgi/osgi.enroute/commit/32c54eb654a86e4cd79a80b2e7c5dd659962c44a
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Thomas Driessen via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Mave archetype repository not reachableDate: Tue, Feb 26, 2019 9:24 AM 
Hi,
 
currently the repository for enroute maven archetypes, i.e.,
https://oss.sonatype.org/content/groups/osgi
is returning 404.
 
I assume this is not intended.
 
Kind regards,
Thomas
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] SCR - Could not obtain lock

2019-02-04 Thread BJ Hargrave via osgi-dev
You should report this to the Apache Felix SCR JIRA component. That is where the Felix SCR developers can respond to the exception.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alain Picard via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] SCR - Could not obtain lockDate: Sat, Feb 2, 2019 2:36 PM 
I regularly get this exception when starting our app, w/o having ever seen any impact.
 
!ENTRY org.eclipse.equinox.cm 4 0 2019-02-02 14:31:46.715!MESSAGE Could not obtain lock!STACK 0java.lang.IllegalStateException: Could not obtain lock    at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainLock(AbstractComponentManager.java:231)    at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainActivationWriteLock(AbstractComponentManager.java:266)    at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:633)    at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:609)    at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:426)    at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:284)    at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$1.configurationEvent(RegionConfigurationSupport.java:89)    at org.eclipse.equinox.internal.cm.EventDispatcher$1.run(EventDispatcher.java:89)    at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)
 
IIRC I have seen forum threads to this effect, but is there anything that we should do with this ? If it happens once the product is deployed that doesn't look good and I hate putting exceptions under the rug.
 
Please advise.
 
Cheers,
Alain
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Overwriting OCD name per Designate

2019-01-28 Thread BJ Hargrave via osgi-dev
There is not a way for a Designate element to alter the OCD to which it refers. So it would be up to any UI to detect that multiple Designates refer to the same OCD and generate a UI which can disambiguate them. So Felix Web Console should be updated.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Konrad Windszus via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Overwriting OCD name per DesignateDate: Mon, Jan 28, 2019 9:04 AM 
 We have a use case where we want to reuse the same metatype OCD for multiple different designates.

 
The according metatype xml  (generated by bnd from Annotations, ) looks like this
 

http://www.osgi.org/xmlns/metatype/v1.2.0" localization="OSGI-INF/l10n/com.adobe.acs.commons.httpcache.config.impl.KeyValueConfig">
  
    
    
    
    
  
  
    
  
  
    
  
  
    
  
  
    
  

 
The sources are at https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/adobe/acs/commons/httpcache/config/impl/KeyValueConfig.java and e.g. https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/adobe/acs/commons/httpcache/config/impl/RequestCookieHttpCacheConfigExtension.java for one Designate.
 
Within the Apache Felix Web Console. those appear 4 times with the same name "ACS AEM Commons - HTTP Cache - Key / Value extension" (only), although each refers to a different OSGi service. Is it possible to easily overwrite the OCD name per Designate somehow or would you rather say this is a bug/limitation of the Felix Web Console which just exposes the OCD name but not the factory PID in the UI?
 
Thanks,
Konrad
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Edit 3.9.3 linebreak before unrelated example

2018-12-27 Thread BJ Hargrave via osgi-dev
Thanks for the feedback. I have added a paragraph break to the source file so the next release will have it.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Bernd Eckenfels via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Edit 3.9.3 linebreak before unrelated exampleDate: Sun, Dec 23, 2018 5:14 PM 
Hello, the following paragraph in R7 Core 3.9.3. could benefit from a line break before the „For Example“ (in a future edition), as it stands it reads like this is an example for the single wildcard case where it is actually an example for subpackage wildcards, therefore a linebreak would reduce the confusion:
„„„
The single wildcard means that the Framework must always delegate to the parent class loader first, which is the same as the Release 3 behavior. For example, when running on an Oracle JVM, it may be necessary to specify a value like: ...
“““
 
Do you think it’s worth to put that nit into the bugzilla?
 
Gruss
Bernd
--
http://bernd.eckenfels.net
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] equinox env started notification

2018-11-19 Thread BJ Hargrave via osgi-dev
There are framework events which indicate the framework has started: https://osgi.org/specification/osgi.core/7.0.0/framework.lifecycle.html#d0e8798
 
But the larger question is "When have all the bundles completed their initialization and are ready for work?". This is a harder question to answer as many things can be happening asynchronously and reactively (since services are reactive and react to other services).
 
There has been lots of discussion on this but no general answer. In the OSGi expert groups, this is still an active discussion thread.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Nhut Thai Le via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] equinox env started notificationDate: Mon, Nov 19, 2018 3:16 PM 
Hello,
 
We are using equinox as an osgi container to host our application which comprise a large number of osgi bundles. Our concern at this point is that when we start equinox, we don't know when all the bundles have been loaded and the startup has finished. Does anyone have a suggestion?
 
Thank you in advance
 
Thai
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] osgi and timer task

2018-11-19 Thread BJ Hargrave via osgi-dev
The OSGi framework know about things registered via the OSGi framework API such as services and framework listeners. The OSGi framework does not know about everything in the JVM such as threads, open files, open sockets, etc. So it cannot manage them for a bundle. So your bundle need to manage the resources it uses such that if a resource needs to be closed or otherwise disposed of when the bundle stops, then your bundle needs to explicitly close or otherwise dispose of the resource.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Ali Parmaksız via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] osgi and timer taskDate: Mon, Nov 19, 2018 12:10 PM 
Hi all,
 
I have an osgi bundle. And this bundle starts a timer. If i stop the bundle, timer stops too?
 --

Ali ParmaksızTEL:5052555693
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Validating repository XML?

2018-10-08 Thread BJ Hargrave via osgi-dev
Did you try
 
http://www.osgi.org/xmlns/repository/v1.0.0"            name="example">                         value="org.apache.felix.framework"/>                       value="osgi.bundle"/>                       value="6.0.1"                 type="Version"/>      
 
Note the use of the local name on the main repository element (I picked "repo" for my example).
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mark Raynsford via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Validating repository XML?Date: Mon, Oct 8, 2018 7:11 AM 
Hello.It seems as though it's not possible to validate XML repository filesagainst the published schema. I'm using the XSD from:  https://osgi.org/xmlns/repository/v1.0.0/repository.xsdI've tried to validate numerous repository files produced by BND withno luck. Even the following minimal example fails:http://www.osgi.org/xmlns/repository/v1.0.0"            name="example">                         value="org.apache.felix.framework"/>                       value="osgi.bundle"/>                       value="6.0.1"                 type="Version"/>      The error is:cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.osgi.org/xmlns/repository/v1.0.0":resource}'. One of '{resource, referral, WC[##other:"http://www.osgi.org/xmlns/repository/v1.0.0"]}' is expected.At: 3:13I'm using a validator that supports XML Schema 1.1 (I understand thatthis is required due the published schema being non-deterministic).What's wrong here?--Mark Raynsford | http://www.io7m.com 
 
att3jm7a.datType: application/pgp-signatureName: att3jm7a.dat
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 



att4dz0l.dat
Description: Binary data
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] R7 Javadoc links broken on osgi.org

2018-10-02 Thread BJ Hargrave via osgi-dev
This should be fixed now.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Konrad Windszus via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] R7 Javadoc links broken on osgi.orgDate: Mon, Oct 1, 2018 4:06 AM 
Hi,according to https://www.osgi.org/javadoc-for-the-osgi-api/ the javadoc for Compendium R7 should be available at https://osgi.org/javadoc/osgi.cmpn/7.0.0/.Unfortunately that link leads to a redirect (302) to https://www.osgi.org/.The same happens for the other R7 javadocs.Thanks in advance for looking into this,Konrad___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Getting bundle symbolic name in Component property annotation

2018-09-06 Thread BJ Hargrave via osgi-dev
No. But you can get that from BundleContext which you can have injected.
 
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alain Picard via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Getting bundle symbolic name in Component property annotationDate: Thu, Sep 6, 2018 1:57 PM 
Is there a pre-defined constant or character like the $ for PID that can be used to compose a component property and inject the bundle symbolic name?
 
Thanks
Alain
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Typos/Errata in R7 compendium

2018-08-31 Thread BJ Hargrave via osgi-dev
You can file a bug in the OSGi public bugzilla: https://osgi.org/bugzilla
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Thomas Driessen via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: "OSGi Developer Mail List" Cc:Subject: [osgi-dev] Typos/Errata in R7 compendiumDate: Fri, Aug 31, 2018 10:29 AM Hi,
 
what do I have to do to report typos/errata in the compendium spec?
 
Kind regards,
Thomas
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Logger at startup

2018-08-27 Thread BJ Hargrave via osgi-dev
Equinox has the LogService implementation built into the framework, so it starts logging very early.
 
In the alternate, for framework related information, you can write your own launcher and it can add listeners for the framework event types.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: David Leangen via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Logger at startupDate: Sun, Aug 26, 2018 3:06 PM 
Hi!I’m sure that this question has been asked before, but I did not successfully find an answer anywhere. It applies to both R6 and R7 logging.I would like to set up diagnostics so I can figure out what is happening during system startup. however, by the time the logger starts, I have already missed most of the messages that I needed to receive and there is no record of the things I want to see. Another oddity is that even after the logger has started, some messages are not getting logged. I can only assume that there is some concurrency/dynamics issue at play.In any case, other than using start levels, is there a way of ensuring that the LogService (or Logger) is available when I need it?Thanks!=David___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGI enroute bndrun file

2018-07-27 Thread BJ Hargrave via osgi-dev
Well you, the developer, write the requirements (-runrequire) and the bnd-resolver-maven-plugin can resolve these requirements into a set of bundles (-runbundles). The resolver process will have access to the maven project dependencies (via a FileSetRepository) to resolve the requirements into a set of bundles.
 
See https://github.com/osgi/osgi.enroute/tree/master/examples/microservice/rest-service-test. This project has a bndrun with -runrequires and the pom configures the bnd-resolver-maven-plugin for the project. See https://enroute.osgi.org/examples/020-examples-microservice.html#the-integration-testbndrun for some information on this.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Matthews, Kevin" To: BJ Hargrave Cc: "osgi-dev@mail.osgi.org" Subject: RE: [osgi-dev] OSGI enroute bndrun fileDate: Fri, Jul 27, 2018 10:21 AM  
Thanks BJ. So, there is a bnd plugin referencing the FileSetRepository using the new enroute to write bundle(s) run time requirements to the bndrun file? Because I still have add my bundle dependencies/versions in this file. I think there are bnd plugins that resolve and validates the component dependencies for wiring.
 
From: BJ Hargrave [mailto:hargr...@us.ibm.com]Sent: Friday, July 27, 2018 10:04 AMTo: Matthews, KevinCc: osgi-dev@mail.osgi.orgSubject: RE: [osgi-dev] OSGI enroute bndrun file
 
Well enRoute is currently maven based and uses the Bnd maven plugins which themselves use the FileSetRepository. One of the links was to one of the Bnd maven plugins using it. So you don't need to do anything to use this support. It is part of the maven and gradle plugin's support.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Matthews, Kevin" To: BJ Hargrave , "osgi-dev@mail.osgi.org" Cc:Subject: RE: [osgi-dev] OSGI enroute bndrun fileDate: Fri, Jul 27, 2018 8:31 AM 
How do we use these java and groovy file in enroute OSGI project?
For, gradle project do we reference FileSetRepositoryConvention  as task in the build.gradle
 
From: BJ Hargrave [mailto:hargr...@us.ibm.com]Sent: Thursday, July 26, 2018 3:30 PMTo: Matthews, Kevin; osgi-dev@mail.osgi.orgSubject: Re: [osgi-dev] OSGI enroute bndrun file
 
The most recent versions of the gradle and maven support will make the project's dependencies available as bundles to the bndrun files.
 
For example:
https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/maven/bnd-export-maven-plugin/src/main/java/aQute/bnd/maven/export/plugin/ExportMojo.java#L107-L109
 
and
 
https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/biz.aQute.bnd.gradle/src/aQute/bnd/gradle/FileSetRepositoryConvention.groovy#L33-L36
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Matthews, Kevin via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: "osgi-dev@mail.osgi.org" Cc:Subject: [osgi-dev] OSGI enroute bndrun fileDate: Thu, Jul 26, 2018 3:05 PM 
Hello,
 
I would like to know will there be any change in the future to Enroute project as to how we add dependencies to .bdnrun Requirements project. It seems, if we create an OSGI project we have to add dependencies to maven or gradle pom.xml build.gradle then we have add dependencies to our composite application .bndrun file. Will there be in the future such as a maven plugin or gradle plugin to automactically add transitive dependies to the .bndrun file. Sometimes we have to maintain 2 files build management and run requirements file and just to wire components can take time.
 
Kevin Matthews Senior Application Analyst 
First Data, 3975 NW 120 Ave, Coral Springs, FL 33065Office: 954-845-4222 | Mobile: 561-465-6694kevin.matth...@firstdata.com | firstdata.com 
 
The information in this message may be proprietary and/or confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify First Data immediately by replying to this message and deleting it from your computer.
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 
 
 
 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGI enroute bndrun file

2018-07-27 Thread BJ Hargrave via osgi-dev
Well enRoute is currently maven based and uses the Bnd maven plugins which themselves use the FileSetRepository. One of the links was to one of the Bnd maven plugins using it. So you don't need to do anything to use this support. It is part of the maven and gradle plugin's support.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Matthews, Kevin" To: BJ Hargrave , "osgi-dev@mail.osgi.org" Cc:Subject: RE: [osgi-dev] OSGI enroute bndrun fileDate: Fri, Jul 27, 2018 8:31 AM  
How do we use these java and groovy file in enroute OSGI project?
For, gradle project do we reference FileSetRepositoryConvention  as task in the build.gradle
 
From: BJ Hargrave [mailto:hargr...@us.ibm.com]Sent: Thursday, July 26, 2018 3:30 PMTo: Matthews, Kevin; osgi-dev@mail.osgi.orgSubject: Re: [osgi-dev] OSGI enroute bndrun file
 
The most recent versions of the gradle and maven support will make the project's dependencies available as bundles to the bndrun files.
 
For example:
https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/maven/bnd-export-maven-plugin/src/main/java/aQute/bnd/maven/export/plugin/ExportMojo.java#L107-L109
 
and
 
https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/biz.aQute.bnd.gradle/src/aQute/bnd/gradle/FileSetRepositoryConvention.groovy#L33-L36
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Matthews, Kevin via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: "osgi-dev@mail.osgi.org" Cc:Subject: [osgi-dev] OSGI enroute bndrun fileDate: Thu, Jul 26, 2018 3:05 PM 
Hello,
 
I would like to know will there be any change in the future to Enroute project as to how we add dependencies to .bdnrun Requirements project. It seems, if we create an OSGI project we have to add dependencies to maven or gradle pom.xml build.gradle then we have add dependencies to our composite application .bndrun file. Will there be in the future such as a maven plugin or gradle plugin to automactically add transitive dependies to the .bndrun file. Sometimes we have to maintain 2 files build management and run requirements file and just to wire components can take time.
 
Kevin Matthews Senior Application Analyst 
First Data, 3975 NW 120 Ave, Coral Springs, FL 33065Office: 954-845-4222 | Mobile: 561-465-6694kevin.matth...@firstdata.com | firstdata.com 
 
The information in this message may be proprietary and/or confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify First Data immediately by replying to this message and deleting it from your computer.
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 
 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGI enroute bndrun file

2018-07-26 Thread BJ Hargrave via osgi-dev
The most recent versions of the gradle and maven support will make the project's dependencies available as bundles to the bndrun files.
 
For example:
https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/maven/bnd-export-maven-plugin/src/main/java/aQute/bnd/maven/export/plugin/ExportMojo.java#L107-L109
 
and
 
https://github.com/bndtools/bnd/blob/26db7e381621f87ac81810fffe86e0c2224a6af0/biz.aQute.bnd.gradle/src/aQute/bnd/gradle/FileSetRepositoryConvention.groovy#L33-L36
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Matthews, Kevin via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: "osgi-dev@mail.osgi.org" Cc:Subject: [osgi-dev] OSGI enroute bndrun fileDate: Thu, Jul 26, 2018 3:05 PM  
Hello,
 
I would like to know will there be any change in the future to Enroute project as to how we add dependencies to .bdnrun Requirements project. It seems, if we create an OSGI project we have to add dependencies to maven or gradle pom.xml build.gradle then we have add dependencies to our composite application .bndrun file. Will there be in the future such as a maven plugin or gradle plugin to automactically add transitive dependies to the .bndrun file. Sometimes we have to maintain 2 files build management and run requirements file and just to wire components can take time.
 
Kevin Matthews Senior Application Analyst 
First Data, 3975 NW 120 Ave, Coral Springs, FL 33065Office: 954-845-4222 | Mobile: 561-465-6694kevin.matth...@firstdata.com | firstdata.com 
 
The information in this message may be proprietary and/or confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify First Data immediately by replying to this message and deleting it from your computer.
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Tool/API to analyze component dependencies

2018-07-17 Thread BJ Hargrave via osgi-dev
Yes, that is at runtime.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alain Picard To: hargr...@us.ibm.comCc: osgi-dev@mail.osgi.orgSubject: Re: [osgi-dev] Tool/API to analyze component dependenciesDate: Tue, Jul 17, 2018 8:07 AM 
Thanks BJ, from what I see that will do the trick, expect that it is runtime, but I can live with that.
 
Alain 

On Tue, Jul 17, 2018 at 7:58 AM BJ Hargrave <hargr...@us.ibm.com> wrote:
Look at the ServiceComponentRuntime service: https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-introspection
 
It provides access to DTOs which describe each component description, ComponentDescriptionDTO, and actual component instances, ComponentConfigurationDTO. You can follows the ReferenceDTOs to see the dependency graph.
 
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alain Picard via osgi-dev <osgi-dev@mail.osgi.org>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Tool/API to analyze component dependenciesDate: Tue, Jul 17, 2018 6:27 AM 
As I'm going through our migration to DS I am in need of understanding our component "graph" and to make sure there are no cycles. For the core ones, I manually created of small dot file from the @Reference and used graphviz to render.
 
Now I am looking for some API to automate the process, at dev time if possible. AFAIK, DS will read the component.xml and create a registry with all info. Can I make use of this resolution to grab all the info that I need?
 
Thanks
Alain
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Tool/API to analyze component dependencies

2018-07-17 Thread BJ Hargrave via osgi-dev
Look at the ServiceComponentRuntime service: https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-introspection
 
It provides access to DTOs which describe each component description, ComponentDescriptionDTO, and actual component instances, ComponentConfigurationDTO. You can follows the ReferenceDTOs to see the dependency graph.
 
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alain Picard via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Tool/API to analyze component dependenciesDate: Tue, Jul 17, 2018 6:27 AM 
As I'm going through our migration to DS I am in need of understanding our component "graph" and to make sure there are no cycles. For the core ones, I manually created of small dot file from the @Reference and used graphviz to render.
 
Now I am looking for some API to automate the process, at dev time if possible. AFAIK, DS will read the component.xml and create a registry with all info. Can I make use of this resolution to grab all the info that I need?
 
Thanks
Alain
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] forcing a karaf to use a lower version of two imported packages versions

2018-07-16 Thread BJ Hargrave via osgi-dev
The import range in CNS says it will work with any version 1.x of com.foo. So the resolver is free to resolve CNS to use any 1.x version of the package com.foo. You can control the version sources by limiting which bundles are installed. If you want to get really fancy, you can implement a ResolverHook [1] which can then influence the resolution of CNS. Note: the resolver hook implementation bundle must be started, and its ResolverHookFactory service registered, before the framework attempts to resolve CNS.
 
[1] https://osgi.org/specification/osgi.core/7.0.0/framework.resolverhooks.html
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mohamed AFIF via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] forcing a karaf to use a lower version of two imported packages versionsDate: Mon, Jul 16, 2018 4:48 AM 
 
hello Everybody,
 
We would like to maintiain a backward compatibility as much as possible of our software , it means if consumer  modifiy a bundle version N, and  if we deliver a new version N+1 , he could keep using his modified bundle until he will be ready to use N+1. So to allow this the only way I've found after many days of brainstorming is to have the same bundle with the many versions on Karaf, so this my real use case and my question:
 
let's have:
 
-  two  bundles (API)  API1.0 and    API1.1:     both of them   export package    com.foo.Inetrface  (this interface has been modified by consumer and kept the same name , in the same artifact
- one consumer bundle CNS importing package from API  using this range  [1.0,2)==> will include   API1.0 and    API1.1.
 
 
is there any way to tell CNS ( on   runtime or compile time ) which version of API it should consume ?
Concretely  as CNS will refrence the higer version (1.1) I would like to force if to use 1.0 (in the case when Client will have modified initial version API 0.0 to API 1.0, and after we will deliver to hil a nexw version API 1.1, so the client should continue to use API 1.0 with CNS )
 
i Thought of a kind of bundle proxy which will include  API1.0 and    API1.1,  and than will have the repsonsablity to drive toward 1.0 or 1.1 but , finally it's very hard to develop especially  I shoud touch Classloaders ...
 
Many thans for your help
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Functions as configuration

2018-07-13 Thread BJ Hargrave via osgi-dev
Component properties are basically service properties which are basically meant to be things that can go in a Configuration: https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#i3217016. Complex objects including objects implementing functional interfaces are not in scope for a Configuration.
 
That said, I imagine you could pass any value object in the Dictionary supplied to ComponentFactory.newInstance since they are not stored in Configuration Admin and SCR would not police the value object types :-)
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: David Leangen via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: David Leangen via osgi-dev Cc:Subject: [osgi-dev] Functions as configurationDate: Fri, Jul 13, 2018 3:32 PM 
Hi!Is there any way to include functions as part of a component configuration?Cheers,=David___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] How would you implement SLF4J binding ?

2018-07-12 Thread BJ Hargrave via osgi-dev
You can see what I have done for an SLF4J binding for the OSGi Log Service 1.4 spec in R7 at https://github.com/osgi/slf4j-osgi. I will note I have not tried it in a while, so it may be in need of some attention.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "João Assunção via osgi-dev "Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] How would you implement SLF4J binding ?Date: Thu, Jul 12, 2018 11:09 AM 
Hello all,
 
I'm currently trying to implement a facade for a metrics library and one of the objectives is to make its usage agnostic of the runtime environment. At my place, we have some components that are mainly used in the context of an OSGi container but can also be used in plain Java applications. I want to have three implementations of the facade where one makes use of an OSGi service, the other is a plain java library and the third a no-op.  In essence, I want the usage of this facade to be similar to SLF4J. While replicating the mechanism used in SLF4J I remembered someone in this mailing list saying that the way SLF4J binds to the implementations is a hack and not recommended. I agree with the hack part but to me, as a user, it works quite well.
If anyone could suggest better approaches I would be very grateful.
 
PS:
This is what I'm trying to achieve:
 
private final Counter aCounter = MetricsFactory.getCounter("aCounter");...
 
 
Thank you. 

João Assunção
 
Email: joao.assun...@exploitsys.com
Mobile: +351 916968984
Phone: +351 211933149
Web: www.exploitsys.com
 
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGi Logging

2018-07-11 Thread BJ Hargrave via osgi-dev
The OSGi Logger does not have a bundle which sends the log to the console. It may be a nice addition to enRoute to add a bundle which collects the log entries (perhaps via a LogStream) and formats them for output to the console.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Paul F Fraser via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] OSGi LoggingDate: Tue, Jul 10, 2018 10:41 PM 
Somewhere in an Eclipsecon video or some other source I came across some info on the new loggingsetup which I cannot find now. It might have been David and Carsten, but not sure.The spec will be most valuable once I understand what is going on!Anyway, to the point, is there an approach which has a console output like slf4j.simple. If so, how?The only references I have found so far uses either Karaf and/or pax logging.Mike Francis asked for suggestions for examples and I think logging would be a good one. It isgenerally overlooked in most presentations.Paul Fraser___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGi enRoute R7 examples

2018-07-03 Thread BJ Hargrave via osgi-dev
Yes. If the -runfw cannot be located, the launcher can manifest an error like this.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Paul F Fraser via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: Re: [osgi-dev] OSGi enRoute R7 examplesDate: Tue, Jul 3, 2018 5:56 AM 
Tim,Would this problem be related?"Error: Could not find or load main class aQute.launcher.Launcher"Also is the enRoute documentation still to be followed as is, for instance settings.xml and the cli archetype commands?PaulOn 3/07/2018 7:05 PM, Tim Ward via osgi-dev wrote:
Hi all,
 
This is just a heads up for anyone who has been working with the OSGi enRoute R7 examples and indexes that you may notice some resolution changes and/or build errors. This is because of a recent PR which updates the enRoute indexes to use a number of newly released R7 reference implementations. The good news is that this means that all of the RIs used by OSGi enRoute are now official releases, including the implementations shipped with Eclipse Photon, and so any subsequent changes should be much less disruptive.
 
The big change that you will probably notice is that the OSGi framework used by the enRoute templates and indexes has changed from being a snapshot of Apache Felix (which provided the R7 APIs, but not necessarily all of the features) to the official R7 RI from Eclipse Equinox. If you run through the tutorials now then you shouldn’t notice anything different, but if you have a project built on previous versions then you will need to change the target framework in your bndrun files from “org.apache.felix.framework" to “org.eclipse.osgi”.
 
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Porting bnd workspace to bndtools 4.0.0

2018-06-29 Thread BJ Hargrave via osgi-dev
Delete the Service-Component header. Bnd will add it if necessary for any DS components.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Henrik Niehaus via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Porting bnd workspace to bndtools 4.0.0Date: Fri, Jun 29, 2018 11:44 AM 
I updated to Eclipse Photon and bndtools 4.0.0. To port my old bndtoolsworkspace I started with a clean workspace and used the OSGi template.(I did that, because the old one had some repo plug-ins missing and Icouldn't figure out how to resolve that.) Then I copied over all mybundle projects and faced the following problems:1. For the Service-Component header I had to fill in every componentinstead of *No big deal, but kind of tedious.2. I had to add a Service-Component header for each bundle, even thoughthey didn't contain any componentIs this a regression, or did the spec change, so this is mandatory?3. I have a project with multiple bundles using the -sub header. In thisproject I get "Service-Component entry can not be located in JAR:OSGI-INF/test.impl.Noop.xml~" for each component. The "generated"directory is empty. Here is an example project:https://github.com/hampelratte/bndtools-example.gitI assume this is a bug. Or am I missing a directive in one of the bnd files?Best regardsHenrik___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Using a Vaadin Application Archetype as a Maven Module in the reactor

2018-06-20 Thread BJ Hargrave via osgi-dev
I am not sure what your question is. What I saw on the vaadin link should work fine. The bnd-maven-plugin will use the bnd.bnd file in the project for bnd instructions.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Paul F Fraser via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Using a Vaadin Application Archetype as a Maven Module in the reactorDate: Wed, Jun 20, 2018 3:07 AM 
Vaadin instructions for OSGi-fying a Vaadin application is at https://vaadin.com/docs/v8/framework/advanced/advanced-osgi.html
The reactor pom seems to handle most of the info suggested by Vaadin to be placed in a bnd file.
Bundle-Name: ${project.name}Bundle-Version: ${project.version}Bundle-SymbolicName: ${project.groupId}.${project.artifactId}Export-Package: com.example.osgi.myapplicationImport-Package: *Web-ContentPath: /myappWould a bnd file still be required?Any suggestions as to how to get this combination working.I have tried, but so far, no luck.Paul Fraser 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] enRoute Quickstart Maven Build Failure

2018-05-16 Thread BJ Hargrave via osgi-dev
I made a PR to change to change to 4.0.0 from snapshot.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Tim Ward via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: Paul F Fraser , OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] enRoute Quickstart Maven Build FailureDate: Wed, May 16, 2018 1:00 AM 
The bnd project has just released 4.0.0 which means that 4.0.0-SNAPSHOT is no longer available. The enRoute templates will therefore need updating to use that version. It should be a fairly quick find/replace in the reactor pom until the enRoute templates are updated. I’d make the update now, but I’m on vacation without my laptop.TimSent from my iPhone> On 16 May 2018, at 05:43, Paul F Fraser via osgi-dev  wrote:>>> On 8/05/2018 8:08 PM, Tim Ward via osgi-dev wrote:>> The enRoute project has now been updated to use the released R7 API as well as released versions of Declarative Services, Config Admin, Http Whiteboard, JPA Service, Transaction Control, and Configurator. The one remaining snapshot implementation is the JAX-RS whiteboard, which is not yet released Best Regards, Tim>> Time to visit bndtools 4.0.0 and the new enRoute and perhaps leave 3.3 behind...>> At present on the quickstart I am getting build failure on rest and app snapshot skipped.> The failure is -- bnd-maven-plugin-4.0.0-SNAPSHOT.pom is missing.>> The bndtools version installed in Eclipse is 4.0.0> What am I missing?>> Regards> Paul Fraser>>> ___> OSGi Developer Mail List> osgi-dev@mail.osgi.org> https://mail.osgi.org/mailman/listinfo/osgi-dev___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] How to use LoggerFactory with DS?

2018-04-09 Thread BJ Hargrave via osgi-dev
Yes, this is the way to use the new Logger API with DS < 1.4. DS 1.4 has specific support to call to the getLogger method for the component so that you can use field and constructor injection. But to use the new Logger API with DS 1.3 and lower, you will need to method inject the LoggerFactory and call the getLogger method in the bind method.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Fauth Dirk \(AA-AS/EIS2-EU\) via osgi-dev" Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] How to use LoggerFactory with DS?Date: Mon, Apr 9, 2018 6:56 AM  
Hi,
 
as with R7 the LogService is deprecated and instead the LoggerFactory should be used, I wanted to start integrating the LoggerFactory in the Eclipse Platform. But there is not much information about how the usage should be.
 
From what I understand so far, the idea is similar to SLF4J that a Logger instance is created via LoggerFactory. The Logger provides API for logging similar to SLF4J, even with placeholder parameters and exception logging (I like that pretty much).
 
But there is one thing I am not sure if I understand everything correctly. With SLF4J the LoggerFactory is static and the best practice is to create one Logger instance per class by using the LoggerFactory on a static field. This is done to reduce the needed amount of memory for cases where a lot of instances are created of a type. With OSGi R7 the LoggerFactory is a service and not a static helper class. So for DS I need to specify a reference. But actually I don’t want the LoggerFactory, I want a Logger. And I don’t want to create a Logger instance per log statement. I therefore thought of the following pattern for getting an OSGi Logger in my component:
 
@Component
public class StringInverterImpl implements StringInverter {
 
   private Logger logger;
   
   @Override
   public String invert(String input) {
 logger.info("received {} to invert", input);
 return new StringBuilder(input).reverse().toString();
   }
 
   @Reference
   void setLoggerFactory(LoggerFactory factory) {
 this.logger = factory.getLogger(getClass());
   }
}
 
So I have a mandatory reference to LoggerFactory, and once the reference is set, I use it to get the Logger instance. Since the reference is static and mandatory I don’t need to take care if the LoggerFactory comes and goes at runtime. And as the service instance typically only exists once, there is also no memory overhead with this. For multi-instance components created by a factory, this could even have the advantage to create a Logger with a name that corresponds to the instance. Which would in turn make the log outputs more speaking in terms of knowing which component instance created the log output.
 
Would this be the recommended way of using logging in R7? Are my observations correct or do I misunderstand something?
 
I would be happy to even write a small blog post about that topic if nobody else is currently writing something with regards to logging in R7.
 
Mit freundlichen Grüßen / Best regardsDirk FauthAutomotive Service Solutions, ESI application (AA-AS/EIS2-EU)Robert Bosch GmbH | Postfach 11 29 | 73201 Plochingen |  GERMANY | www.bosch.comTel. +49 7153 666-1155 | dirk.fa...@de.bosch.com Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar Denner,Prof. Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr. Markus Heyn, Dr. Dirk Hoheisel,Christoph Kübel, Uwe Raschke, Peter Tyroller 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=KLhhCzQK2_oLPcWcFp5689lBYH03leg1tZALSyumNNc=rloQxyhOiezamDZkkd8g3jxNoHOVCG97_gCE7dGmlpk=
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Build issue when wrapping a jar

2018-03-27 Thread BJ Hargrave via osgi-dev
What version of the Bnd Gradle plugin are you using? There is an issue where newer versions of Gradle can delete output folders (like bin) after Bnd thought it created them. So the builder complained.
 
This has been fixed for 4.0 with https://github.com/bndtools/bnd/pull/2256/commits/6f415fd0c3add008d822cdd251af22f6b76cb34c.
 
You may be able to work around this by having 2 gradle executions on your build server. For example `/gradlew --version` followed by `./gradlew ` . The first execution will have the issue of Gradle deleting the folders after Bnd created them, but since you don't actually run any task, Bnd does not complain. The second execution is not a first execution of Gradle on the system, so it won't delete the folders that Bnd expects and Bnd should proceed fine.
 
See https://github.com/bndtools/bnd/blob/829360a883656b11c3fd2379aae288cdb9b2df11/.travis.yml#L14-L22 where we run Gradle twice.
 
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: David Leangen via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Build issue when wrapping a jarDate: Tue, Mar 27, 2018 6:44 AM 
 
Hi!
 
I have a bnd project that wraps a few jars. It works just fine in Eclipse and for my local gradle build as well.
 
However, when I put it on the build server, it breaks with the following:
 
Warning: Unused Export-Package instructions: [okhttp3*] Warning: Unused Import-Package instructions: [android.*] Warning: Unused Export-Package instructions: [retrofit2*] Error : Unexpected ProjectBuilder init, error java.lang.IllegalArgumentException: A Jar can only accept a valid file or directory: /opt/atlassian/pipelines/agent/build/squareup.adapter/bin, Error : Unexpected ProjectBuilder init, error java.lang.IllegalArgumentException: A Jar can only accept a valid file or directory: /opt/atlassian/pipelines/agent/build/squareup.adapter/bin, Error : Unexpected ProjectBuilder init, error java.lang.IllegalArgumentException: A Jar can only accept a valid file or directory: /opt/atlassian/pipelines/agent/build/squareup.adapter/bin, 
 
 
Any ideas about why this could happen?
 
Thanks!!
=David
 
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=M5eUe5MSY46wRQ8laBgXjfaW_tFTE__yP088pdNbE2w=XOIoKCQX7rMMk8Tv7uD9imXzewh_7sYx-k_IMgmwlC0=
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] JPMS modularization for various OSGi artifacts

2018-03-22 Thread BJ Hargrave via osgi-dev
The R7 final API jars are already built and ready for release to Maven Central once the OSGi members approve the specifications as final (ETA mid April). These jars do not have Automatic-Module-Name manifest entries in them. Just adding that is only a partial step. Unless you also test those jars in module-path mode, you have no idea how/if they will work. See http://blog.joda.org/2018/03/jpms-negative-benefits.html for some discussion of this. At this point, I don't see OSGi adding Automatic-Module-Name manifest entries to any of its artifacts since, of course, OSGi is making OSGi bundles and not JPMS modules :-)
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mark Raynsford via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] JPMS modularization for various OSGi artifactsDate: Wed, Mar 21, 2018 5:39 PM 
Hello!Let's say I'm writing a library that I want to use both on OSGi and ina Java 9 modular context. I write various classes and annotate themwith the standard @Component annotations for declarative services. Ithen go to write a module-info.java so that my code can also act as aJava 9 module... Uh oh, the @Component annotations are declared in ajar that doesn't provide a module-info.class file and doesn't declarean Automatic-Module-Name field in the jar manifest:  http://blog.joda.org/2017/05/java-se-9-jpms-automatic-modules.htmlWith OSGi R7 looming, is there any intention to add at leastAutomatic-Module-Name entries in the various OSGi jars published toCentral? This would allow us to write libraries that are good citizensin both worlds.--Mark Raynsford | http://www.io7m.com 
 
atth838c.datType: application/pgp-signatureName: atth838c.dat
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 



att8vz4e.dat
Description: Binary data
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Can a DS component control its service properties programmatically?

2018-02-13 Thread BJ Hargrave via osgi-dev
You could do this by using a component factory. You would need another component to get the ComponentFactory service and call ComponentFactory.newInstance with the desired endpoint.framework.uuid service property.
 
But this is probably overkill for a single service. For a single service, you can use the life cycle methods of a component (activate/deactivate) to manually register/unregister the desired service.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Christian Schneider via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Can a DS component control its service properties programmatically?Date: Tue, Feb 13, 2018 6:11 AM 
I would like to create a component that is an remote service admin EndpointEventListener. 
So it needs a property endpoint.listener.scope with a filter string. 
The problem now is that I want this scope to only include endpoints from the local framework. So I need something like:
(endpoint.framework.uuid=)
So I think I can not do this using the @Component annotation. Can I set this property in the @Activate method somehow?
 
Christian
 --

--Christian Schneiderhttp://www.liquid-reality.de
 
Computer Scientist
http://www.adobe.com
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=KNdsR2O_JTMoIJPv3z_zAhrlxA4U8gi-QU86NbLSw1M=od1CGLzcq5KZkSVHMLAtn19Hsz53S5UV2g0HzkUrgRY=
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] DS Reference injection order

2018-01-31 Thread BJ Hargrave via osgi-dev
Tim correctly cites the spec regarding the order SCR must process the  elements in the XML. Since you are using annotations, there is one more thing to know. The javadoc for the Reference annotation states:
 
In the generated Component Description for a component, the references must be ordered in ascending lexicographical order (using String.compareTo ) of the reference names. 
 
So you can control the order of the reference elements in the xml by the names of the references.
 
The order of processing reference can be useful if you are using method injection and a method needs to use a previously injected reference. But since you examples show field injection, your component cannot not really observe the order of injection.
 
With 'volatile' you have a dynamic reference which can be updated at any time, so there is no order with respect to other reference.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Tim Ward via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: Thomas Driessen , OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] DS Reference injection orderDate: Wed, Jan 31, 2018 6:43 AM 
Firstly - why do you need to rely on this? It sounds like very fragile code to me and you should probably consider rewriting so that you don’t need to care. However...
 Section 112.5.7 of the compendium says that:

When binding services, the references are processed in the order in which they are specified in the component description. That is, target services from the first specified reference are bound before services from the next specified reference.
 
A static optional service will not be set if it is not satisfied, or will if it is. A dynamic optional service will behave the same way, but it may be unset and reset many times afterwards on other threads. Dynamic services should always be treated with care, whether they are optional or not.
 
Tim
 
On 31 Jan 2018, at 10:50, Thomas Driessen via osgi-dev  wrote: 

Hi,
 
I searched the compendium spec but didn't find what I was looking for.
 
If I have a DS with multiple references to other DS
 
@Component
class Example1{
 
    @Reference
    Example2 e2
 
    @Reference
    Example3 e3
}
 
in which order are the references injected? Is there even a deterministic order?
 
In the above example both references are static/mandatory. What happens if I have a static/mandatory and a dynamic/optional one like this:
 
@Component
class Example1{
 
    @Reference
    Example2 e2
 
    @Reference
    volatile Example3 e3
}
 
Kind regards,
Thomas___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=P8DWwyvfdkJmQulD35LW62YOdKbDVw6eIWSALp1HIbI=U70U3kBVjtwoTlXKCafEOLUaXN8uM6uEth9KO1zjavY=
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGi Push Streams

2018-01-02 Thread BJ Hargrave via osgi-dev
You can get the snapshots from https://oss.sonatype.org/content/repositories/osgi/
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Thomas Driessen via osgi-dev Sent by: osgi-dev-boun...@mail.osgi.orgTo: "OSGi Developer Mail List" Cc:Subject: [osgi-dev] OSGi Push StreamsDate: Tue, Jan 2, 2018 2:54 PM  Hi,
 
where can I find the current reference implementation for the upcoming OSGi Push Streams? 
I've seen some talks about it, but could not find it anywhere. 
Apache Aries had them in their repository, but the last update has been last year.
 
 Kind regards,
Thomas
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=6yFsTaX9rwsWCrIEj3tc9TT2soXqHXlLzBbjicF0ZZY=SQettGiogoFwA-7V4af6Cl5SrQQ4O3AVx7Vq6SJ7yts=
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Component Life Cycle: When are DS components/services registered

2017-12-11 Thread BJ Hargrave via osgi-dev
The smart thing to do is to wait for the component's service to be 
registered. This means that the component's dependencies are satisfied. 
The component's bundle being active is just one such dependency but there 
can be others.
-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargr...@us.ibm.com

office: +1 386 848 1781
mobile: +1 386 848 3788




From:   Konrad Windszus via osgi-dev <osgi-dev@mail.osgi.org>
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Date:   2017/12/10 05:53
Subject:[osgi-dev] Component Life Cycle: When are DS 
components/services registered
Sent by:osgi-dev-boun...@mail.osgi.org



Hi, 
I have a question about the component life cycle of DS components and the 
relation to the containing bundle's life cycle.

According to OSGi Comp R6, 112.5.1 "the life cycle of a component is 
contained within the life cycle of its bundle". But is it a valid 
assumption that all enabled components are registered before the 
containing bundle becomes active? Is the same true for services? Or does 
the registration of the services/components only happen after the bundle 
has switched to state active?

The life cycle example at 112.5.17 unfortunately is also very vague in 
that regard as it only talks about "bundle started" event.

I need to know this information in the context of executing an IT against 
a remote OSGi container. The IT should only start to execute, once a 
particular (lazy) component is registered. Is it enough to wait for the 
Bundle status "Active", or do I really have to check the status of this 
particular component?

Thanks in advance,
Konrad





___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=LP_CgrFm7Moxaw6UGi9rM-O_ASVG1ky4ynvk0Y18GMI=KLEf2yFvPZpVv68jjRkzpnfqYUyWoWfbFX0OUP1QUCs=






___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] making an existing interface method default causes MINOR baseline change

2017-12-05 Thread BJ Hargrave via osgi-dev
When doFoo() was implemented in Bar some user's class could have been 
compiled to make a direct method call to Bar.doFoo() instead of via the 
Foo interface's Foo.doFoo() signature. It depends upon how the compiler 
emits the invokevirtual call in the bytecode. So when you remove the 
method from Bar, you could potentially break users of Bar that directly 
referenced the concrete method Bar.doFoo(). In fact I would think removing 
doFoo() from Bar should be a major change. The safest thing is to leave 
doFoo() in Bar and implement it as calling the super method.
-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargr...@us.ibm.com

office: +1 386 848 1781
mobile: +1 386 848 3788




From:   "Fauth Dirk \(AA-AS/EIS2-EU\) via osgi-dev" 
<osgi-dev@mail.osgi.org>
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Date:   2017/12/05 11:35
Subject:Re: [osgi-dev] making an existing interface method default 
causes MINORbaseline change
Sent by:osgi-dev-boun...@mail.osgi.org



Hi,
 
IMHO it is a MINOR change because it is not a breaking change. J
 
With that change neither implementations of the Foo interface, nor classes 
that extend the abstract Bar class will break. 
 
Implementations of the Foo interface can still implement the doFoo() 
method and by doing this override the default behavior. Overriding a 
default is not a breaking change as you neither add a new public method or 
field, you just give a default implementation.
 
Classes that extend Bar did not need to implement doFoo() before, as it 
was implemented in Bar. Removing that method would be typically a breaking 
change. But you are moving it as default method to the Foo interface. 
Therefore Bar still has the doFoo() method implemented, as it is provided 
by the Foo interface.
 
I have to admit that I am not 100% sure about the byte code in the end and 
if that matters. But as a user of the interface and abstract class, 
nothing breaks. 
 
Mit freundlichen Grüßen / Best regards 

Dirk Fauth

Automotive Service Solutions, ESI application (AA-AS/EIS2-EU) 
Robert Bosch GmbH | Postfach 11 29 | 73201 Plochingen | GERMANY | 
www.bosch.com 
Tel. +49 7153 666-1155 | dirk.fa...@de.bosch.com 

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar 
Denner,
Prof. Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, 
Dr. Markus Heyn, Dr. Dirk Hoheisel,
Christoph Kübel, Uwe Raschke, Peter Tyroller 


Von: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org
] Im Auftrag von Raymond Auge via osgi-dev
Gesendet: Dienstag, 5. Dezember 2017 00:26
An: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Betreff: [osgi-dev] making an existing interface method default causes 
MINOR baseline change
 
Hey All,
I think the answer is "Yes it's a MINOR change", but I wanted to clarify.
 
Assume I have the following interface in an exported package:
 
public interface Foo {
   public void doFoo();
}
 
And in the same package I have abstract class Bar which implements Foo:
 
public abstract class Bar implements Foo {
   public void doFoo() {...}
   public abstract void doBar();
}
 
And I want to migrate to a default method because doFoo() logic rarely 
changes:
 
public interface Foo {
   public default void doFoo() {...}
}
 
public abstract class Bar implements Foo {
   //public void doFoo() {...}
   public abstract void doBar();
}
 
Can someone explain why this is a MINOR change?
 
 
-- 
Raymond Augé (@rotty3000)
Senior Software Architect Liferay, Inc. (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance (@OSGiAlliance)
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=03qLQLtoV6C-ROVud69V3ylfqKPTgb75RHT44N2MDN0=aMhF9Peul2ok8PFZTlIG42rzXQY1za2F24iRJva3Plg=



___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Service scope reported as bundle, not as singleton

2017-09-30 Thread BJ Hargrave
SCR always registers a ServiceFactory for the service since SCR must intermediate the service requests to construct the service object from your implementation class. So even though SCR registers ServiceFactory (which show as SCOPE_BUNDLE), since you have declared the component with ServiceScope.SINGLETON, only a single instance of your component class will be created by SCR and provided to all bundles using the service.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Michael Lipp Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Service scope reported as bundle, not as singletonDate: Sat, Sep 30, 2017 1:01 PM 
I'm afraid this is going to turn out as a real stupid question, but ...I have declared a class as service:@org.osgi.service.component.annotations.Component(scope=ServiceScope.SINGLETON)public class BundleListPortletFactory    implements PortletFactory {...}Please ignore that the class name ends in "...Factory". The service isused to create objects, but these objects aren't OSGi services, so ithas the role of a factory in my application, but it is not an OSGiservice factory.The generated XML looks 

Re: [osgi-dev] Class.forName Hell

2017-09-15 Thread BJ Hargrave
Better would also be for the API to not take a String class name but a Class object. The caller likely has access to the named class (or can easily be configured to have access), while the library code which has to load the class from the String class name generally does not which is why we have the "magic" of TCCLs... (sigh)
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Justin Edelson Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Class.forName HellDate: Fri, Sep 15, 2017 2:55 PM 
Given that the Thread Context Classloader is used, can you just set this to the correct value before invoking DefaultComponentFactory.createComponent()? I don't know the fully calling context, so perhaps that won't work. If the TCCL is the wrong choice but happens to work in a non-OSGi environment, the right solution generally is to allow for an alternate classloader to be passed in.
 
On Thu, Sep 14, 2017 at 11:24 PM Paul F Fraser  wrote:
Hi,I do not have the slightest idea if this situation can be handled, but perhaps some kind person canassist.Vaadin uses forName in the following situation and the classes are not found when used in OSGi project.https://github.com/vaadin/framework/blob/master/server/src/main/java/com/vaadin/ui/declarative/Design.java(~ line 200)https://github.com/vaadin/framework/blob/master/server/src/main/java/com/vaadin/server/VaadinServiceClassLoaderUtil.javaIf possible it would be a good contribution if we could suggest a way to Vaadin as to how thisshould/could be handled.Paul Fraser___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=N8OjKyRzJAJe44A7oippEH9juVLJn7KZyY8lmjoFD9M=qcB76DBWcTRiLkhXJSdPT2wzPLAMBsxGOb4RxlmTjyI= 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGi and Java 9

2017-09-08 Thread BJ Hargrave
Part of the issue is that JPMS design was a moving target. Until Java 9 ships, the design was changing. So OSGi had no final design to consider. Once Java 9 is shipped and JPMS design is final, then OSGi experts can consider what, if anything, needs to be specified by OSGi. I cannot promise what will be decided nor when.
 
Since the OSGi experts fully expected OSGi to run unchanged on top of the Java 9 runtime, like the vast majority of existing Java applications, there was no worry that OSGi would be rendered inoperative by Java 9.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov <ooo_satu...@mail.ru>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] OSGi and Java 9Date: Fri, Sep 8, 2017 8:23 AM Thank you very much for your answer. This is very useful information.You say that "there is no answer for that at this time". Can you say approximatelywhen official OSGi answer will appear?To tell the truth the situation seems to be strange for me. I will explain why. It wasknown years ago that Java 9 would support modules using Jigsaw. When I learnedabout it of course I was not glad but I thought that OSGi experts of course wouldthink and work for compatibility. Because as I understand there is Java CommunityProcess and I was sure that OSGi experts will be the most active persons there.However, Java 9 is almost here but there is no answer. I've read many articlesbut all they say that suggested solutions can not be considered for production.And the question is why there is no solution. I see only two reasons - eitherOSGi experts didn't take necessary measures or their requirements were ignored.I am saying all this not to blame someone! I am saying all this trying to understandthe situation and the future/perspective of OSGi platform (all our products are on OSGi).Could anyone give information about the situation?Best regards, Alex 
Четверг, 7 сентября 2017, 23:31 +03:00 от "BJ Hargrave" <hargr...@us.ibm.com>: 
I am sorry I could not help you more. I don't have a detailed checklist of things to do.
 
What I am saying is that JPMS and OSGi can operate at different layers. They do not need to interact. Java 9 runtime classes are loaded by JPMS modules and then an existing application can run on top of that using -classpath just like on Java 8. An OSGi-based application can also run there. Think of it like JPMS runs the -bootclasspath while OSGi runs on the -classpath above the -bootclasspath.
 
So both technologies can exist in the same VM this way. JPMS and OSGi don't have to be friends in this situation. They just need to not interfere with each other :-)
 
If you are asking about how you can install JPMS modules in an OSGi framework just like bundles, then there is no answer for that at this time that I am aware of.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov <ooo_satu...@mail.ru>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] OSGi and Java 9Date: Thu, Sep 7, 2017 4:05 PM Thank you very much for your answer. However, it is absolutely not what I asked.I didn't ask about warnings. I asked about principles how to work with both technologiesat the same time. This is the main reason I started this thread in this mailing list.I am not OSGi expert/developer. I am OSGi user. I wrote to this mailing list to getclear technical solutions how to make JPMS and OSGi friends. I tell the truth -advices "set some options to ignore some messages" is not what I am looking for.Best regards, Alex 
Четверг, 7 сентября 2017, 22:25 +03:00 от "BJ Hargrave" <hargr...@us.ibm.com>: 
You may need to set some options to ignore some warnings. But your OSGi based application should run fine just like other existing apps (assuming you don't use Java internals which Java 9 hides).
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov <ooo_satu...@mail.ru>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] OSGi and Java 9Date: Thu, Sep 7, 2017 1:26 PM Thank you very much for your answer. It is good news. Could you give any informationHOW to use OSGi on Java 9? Should I totally ignore JPMS (use any switches topermit/disable etc) or should I delegate JPMS some tasks (which?) and delegateOSGI other tasks (which?)?Best regards, Alex 
Четверг, 7 сентября 2017, 20:01 +03:00 от "BJ Hargrave" <hargr...@us.ibm.com>

Re: [osgi-dev] OSGi and Java 9

2017-09-07 Thread BJ Hargrave
I am sorry I could not help you more. I don't have a detailed checklist of things to do.
 
What I am saying is that JPMS and OSGi can operate at different layers. They do not need to interact. Java 9 runtime classes are loaded by JPMS modules and then an existing application can run on top of that using -classpath just like on Java 8. An OSGi-based application can also run there. Think of it like JPMS runs the -bootclasspath while OSGi runs on the -classpath above the -bootclasspath.
 
So both technologies can exist in the same VM this way. JPMS and OSGi don't have to be friends in this situation. They just need to not interfere with each other :-)
 
If you are asking about how you can install JPMS modules in an OSGi framework just like bundles, then there is no answer for that at this time that I am aware of.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov <ooo_satu...@mail.ru>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] OSGi and Java 9Date: Thu, Sep 7, 2017 4:05 PM Thank you very much for your answer. However, it is absolutely not what I asked.I didn't ask about warnings. I asked about principles how to work with both technologiesat the same time. This is the main reason I started this thread in this mailing list.I am not OSGi expert/developer. I am OSGi user. I wrote to this mailing list to getclear technical solutions how to make JPMS and OSGi friends. I tell the truth -advices "set some options to ignore some messages" is not what I am looking for.Best regards, Alex 
Четверг, 7 сентября 2017, 22:25 +03:00 от "BJ Hargrave" <hargr...@us.ibm.com>: 
You may need to set some options to ignore some warnings. But your OSGi based application should run fine just like other existing apps (assuming you don't use Java internals which Java 9 hides).
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov <ooo_satu...@mail.ru>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] OSGi and Java 9Date: Thu, Sep 7, 2017 1:26 PM Thank you very much for your answer. It is good news. Could you give any informationHOW to use OSGi on Java 9? Should I totally ignore JPMS (use any switches topermit/disable etc) or should I delegate JPMS some tasks (which?) and delegateOSGI other tasks (which?)?Best regards, Alex 
Четверг, 7 сентября 2017, 20:01 +03:00 от "BJ Hargrave" <hargr...@us.ibm.com>: 
You can use OSGi on Java 9. Just like any other Java program. While the Java runtime class libraries are modularized with the Java Platform Module System (JPMS), your application running on the Java runtime can remain modularized by OSGi. OSGi is not going to stop working on Java 9 :-) In other words, -classpath applications will not stop working on Java 9.
 
Now, there may be some blips and bugs in code that will need to be addressed for Java 9, that can happen with each new major Java release.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov <ooo_satu...@mail.ru>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] OSGi and Java 9Date: Thu, Sep 7, 2017 12:22 PM Hello, everyoneJava 9 is about to be released. The main problem is Java 9 modular system because it seemsto be strange to support two modular systems in one product - I mean Java 9 modular systemand OSGi.What should OSGI users do now with current their products on OSGI? Not to use Java 9 andall future Java versions? Or there are other solutions how to work with OSGI on Java 9?I have found some articles in internet but I would like to hear answer from OSGidevelopers and OSGi experts. I would be thankful for any information.Best regards, Alex
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=xoyDnjWrU3zp8TRG6OOWJMt_kH0AvIDxQhMC12LNc8w=xOKa7s31l9Lf_pHbmjDcB8-8PfdqK-Ua34oJY8fo0DA= 
 --Alex Sviridov
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=Qx0S7sLQPhkNPJQ3kzt9FAx1EuhZA2ExnFKDJIJ4EbI=NRmVxnQ2M8-6zPxS7oXGeD3lRUD8PVlU2_lZ_S16Els= 
 --Alex Sviridov
__

Re: [osgi-dev] OSGi and Java 9

2017-09-07 Thread BJ Hargrave
You may need to set some options to ignore some warnings. But your OSGi based application should run fine just like other existing apps (assuming you don't use Java internals which Java 9 hides).
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov <ooo_satu...@mail.ru>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] OSGi and Java 9Date: Thu, Sep 7, 2017 1:26 PM Thank you very much for your answer. It is good news. Could you give any informationHOW to use OSGi on Java 9? Should I totally ignore JPMS (use any switches topermit/disable etc) or should I delegate JPMS some tasks (which?) and delegateOSGI other tasks (which?)?Best regards, Alex 
Четверг, 7 сентября 2017, 20:01 +03:00 от "BJ Hargrave" <hargr...@us.ibm.com>: 
You can use OSGi on Java 9. Just like any other Java program. While the Java runtime class libraries are modularized with the Java Platform Module System (JPMS), your application running on the Java runtime can remain modularized by OSGi. OSGi is not going to stop working on Java 9 :-) In other words, -classpath applications will not stop working on Java 9.
 
Now, there may be some blips and bugs in code that will need to be addressed for Java 9, that can happen with each new major Java release.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov <ooo_satu...@mail.ru>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] OSGi and Java 9Date: Thu, Sep 7, 2017 12:22 PM Hello, everyoneJava 9 is about to be released. The main problem is Java 9 modular system because it seemsto be strange to support two modular systems in one product - I mean Java 9 modular systemand OSGi.What should OSGI users do now with current their products on OSGI? Not to use Java 9 andall future Java versions? Or there are other solutions how to work with OSGI on Java 9?I have found some articles in internet but I would like to hear answer from OSGidevelopers and OSGi experts. I would be thankful for any information.Best regards, Alex
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=xoyDnjWrU3zp8TRG6OOWJMt_kH0AvIDxQhMC12LNc8w=xOKa7s31l9Lf_pHbmjDcB8-8PfdqK-Ua34oJY8fo0DA= 
 --Alex Sviridov
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=Qx0S7sLQPhkNPJQ3kzt9FAx1EuhZA2ExnFKDJIJ4EbI=NRmVxnQ2M8-6zPxS7oXGeD3lRUD8PVlU2_lZ_S16Els= 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGi and Java 9

2017-09-07 Thread BJ Hargrave
You can use OSGi on Java 9. Just like any other Java program. While the Java runtime class libraries are modularized with the Java Platform Module System (JPMS), your application running on the Java runtime can remain modularized by OSGi. OSGi is not going to stop working on Java 9 :-) In other words, -classpath applications will not stop working on Java 9.
 
Now, there may be some blips and bugs in code that will need to be addressed for Java 9, that can happen with each new major Java release.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Alex Sviridov Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] OSGi and Java 9Date: Thu, Sep 7, 2017 12:22 PM Hello, everyoneJava 9 is about to be released. The main problem is Java 9 modular system because it seemsto be strange to support two modular systems in one product - I mean Java 9 modular systemand OSGi.What should OSGI users do now with current their products on OSGI? Not to use Java 9 andall future Java versions? Or there are other solutions how to work with OSGI on Java 9?I have found some articles in internet but I would like to hear answer from OSGidevelopers and OSGi experts. I would be thankful for any information.Best regards, Alex
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://urldefense.proofpoint.com/v2/url?u=https-3A__mail.osgi.org_mailman_listinfo_osgi-2Ddev=DwICAg=jf_iaSHvJObTbx-siA1ZOg=p-HkGsKTJWWSiO-pz0kKXl8ALzmlqvUGeFfgHUZX8ms=xoyDnjWrU3zp8TRG6OOWJMt_kH0AvIDxQhMC12LNc8w=xOKa7s31l9Lf_pHbmjDcB8-8PfdqK-Ua34oJY8fo0DA= 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Regarding Collection references

2017-07-21 Thread BJ Hargrave
From the javadoc of the Reference annotation:
 
The field option is based upon the policy and cardinality of the reference and the modifiers of the field. If the policy is ReferencePolicy.DYNAMIC, the cardinality is 0..n or1..n, and the field is declared final, the field option is FieldOption.UPDATE. Otherwise, the field option is FieldOption.REPLACE
 
So
 
@Reference(policy = ReferencePolicy.DYNAMIC)
private final Collection factories = new CopyOnWriteArrayList<>();
will set the field option to UPDATE.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Fauth Dirk (AA-AS/EIS2-EU)" Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Regarding Collection referencesDate: Fri, Jul 21, 2017 1:45 AM  
Hi,
 
the answers from BJ and Tim are already saying everything. So I just want to give another view on this, as it took me also a while to get the difference when learning the DS 1.3 stuff.
 
You are using field references on a collection and you specify the reference to be dynamic. So it is a DYNAMIC reference with MULTIPLE cardinality. As you specified the Collection as a final field, I’m honestly not sure whether it is RELUCTANT or GREEDY, but that should not matter as the field is never updated by the SCR.
 
In the OSGi Compendium specification chapter 112.3.8 the reference field option is described. There you can in short read about the two different ways how a Collection field can be handled by SCR.
 
The default is FieldOption#REPLACE. So typically the SCR would replace the collection if a new service comes up or goes away. Having the annotation defaults in mind, this should look like this:
 
@Reference
private volatile Collection factories;
 
If you want to take care of the Collection type yourself and require to keep the Collection instance and want only to update it via Collection#add() and Collection#remove() instead of replacing it, you could use FieldOption#UPDATE.
 
@Reference(policy = ReferencePolicy.DYNAMIC, fieldOption = FieldOption.UPDATE)
private final Collection factories = new CopyOnWriteArrayList<>();
 
Honestly I am not sure if you need to specify the fieldOption when setting the field to be final. The spec in chapter 112.3.8.2 says this:
 
“The update option can only be used for a dynamic reference with multiple cardinality. The
component's constructor can set the field with its choice of collection implementation. In this case,
the field can be declared with the final modifier. The collection implementation used by the component
should use identity rather than equals or hashCode to manage the elements of the collection.
The collection implementation should also be thread-safe since SCR may update the collection from
threads different than those used by the component instance.”
 
The description of the fieldOption helped me to understand that there are different ways to deal with Collections in DS. Maybe it helps you too.
 
Mit freundlichen Grüßen / Best regardsDirk FauthAutomotive Service Solutions, ESI application (AA-AS/EIS2-EU)Robert Bosch GmbH | Postfach 11 29 | 73201 Plochingen |  GERMANY | www.bosch.comTel. +49 7153 666-1155 | dirk.fa...@de.bosch.com Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar Denner,Prof. Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr. Markus Heyn, Dr. Dirk Hoheisel,Christoph Kübel, Uwe Raschke, Peter Tyroller 
Von: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] Im Auftrag von Tim WardGesendet: Freitag, 21. Juli 2017 00:03An: OSGi Developer Mail List Betreff: Re: [osgi-dev] Regarding Collection references
 
Hi Scott,
 
The SCR annotations are interpreted based on the context of where they are applied. This is described in the JavaDoc for the annotations, and the DS spec. 
 
Because you have declared your SCR reference as a final field this means that the SCR will be told to update your collection using add/remove rather than injecting a populated collection. It is therefore up to you to ensure that the collection is thread safe (so in this case ArrayList is a bad choice!). My default in this scenario is to use a CopyOnWriteArrayList. 
 
If instead you make the field non final then you do not need to initialise it. SCR will then be configured to inject a fully populated thread-safe collection and you can use it without fear of invalid state or ConcurrentModificationException. 
 
Another option would be to declare bind/unbind methods and to make the changes to the collection yourself. 
 
I hope this helps. 
 
Tim
 
Sent from my iPhone
On 20 Jul 2017, at 21:49, Leschke, Scott  wrote:
If I have a reference in an SCR component like the 

Re: [osgi-dev] Regarding Collection references

2017-07-20 Thread BJ Hargrave
Thats is not a safe collection type. Why not let DS manage the field?
 
If you need to use a final field, then you need to use a thread safe collection.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Leschke, Scott" Sent by: osgi-dev-boun...@mail.osgi.orgTo: "osgi-dev@mail.osgi.org" Cc:Subject: [osgi-dev] Regarding Collection referencesDate: Thu, Jul 20, 2017 4:50 PM  
If I have a reference in an SCR component like the following,
 
@Reference(policy = ReferencePolicy.DYNAMIC)
private final Collection factories = new java.util.ArrayList<>();
 
Since the collection is updated by the runtime as services come and go, I assume it’s prudent to synchronize
on the collection when iterating over it whereas in Blueprint I got the impression this wasn’t necessary.
 
Would that be correct?
 
Scott Leschke
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Grouping services instantiated by Declarative Services

2017-07-14 Thread BJ Hargrave
If you need to create unique component instances with specific service property values, then you would need to use ComponentFactory. However, then your components would need to reference the proper ComponentFactory and call it to create the desired instance.
 
  @Component(factory="B")  public class B  {    private @Reference D d;  }
  @Component(property = "tag = chocolate", immediate = true)  public class A  {
    private B b;
    private ComponentContext cc;
    @Activate
    private void activate(ComponentContext context) {
  cc = context;
    }    @Reference(target="(component.factory=B)")
    private void bFactory(ComponentFactory f) {
  Dictionary props = new HashMap<>();
  props.put("tag", cc.getProperties().get("tag"));
  b = f.newInstance(props);
    }  }
 
This creates a new instance of B for each instance of A. You may not want this.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mark Raynsford Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Grouping services instantiated by Declarative ServicesDate: Fri, Jul 14, 2017 3:04 PM 
Hello.I have a somewhat unusual problem that would be rather laborious toexplain here. In order to preserve the sanity of those reading thisemail, I'll try to distill it down to something more abstract.I have a situation where I want to instantiate a tree of services, eachof which share a common "tag" property. When a service A declares areference to another service B, the exact instance of B that is useddepends on the value of the tag property on A. This needs to worktransitively.To try to illustrate what I mean, a contrived (and obviouslynon-working example):  @Component  public class D  {  }  @Component  public class B  {    private @Reference D d;  }  @Component(property = "tag = chocolate", immediate = true)  public class A  {    private @Reference B b;  }  @Component(property = "tag = vanilla", immediate = true)  public class C  {    private @Reference B b;  }  @Component(property = "tag = vanilla", immediate = true)  public class E  {    private @Reference D d;  }The A, C, and E components are the "root" components in this example,and the value of the "tag" property will define which specificinstances of D and B get referenced. For example, assuming an OSGisystem that magically implemented what I'm trying to do, the abovearrangement would produce a tree of instances like the following:  http://ataxia.io7m.com/2017/07/14/groups.svg.pngThe process would probably go something like this:The A component has a "chocolate" tag and refers to B. The systeminstantiates a new B with tag "chocolate" (because there isn't anexisting one) and returns a reference to it. The same occurs with Dfor the reference in B.The C component has a "vanilla" tag and refers to B. The existinginstance of B with tag "chocolate" is ignored and a new B with tag"vanilla" is instantiated and returned to C. The same occurs for thereference to D in the "vanilla" B.The E component has a "vanilla" tag and refers to B. The existinginstance of B with tag "vanilla" satisfies the reference.Note that at no point do the definitions of B or D refer to "chocolate"or "vanilla"; the tag is somehow magically propagated by those instancesthat attempt to get a reference to B or D. Naturally, if a hypotheticalcomponent G with tag "strawberry" asked for a reference to A, newinstances of A, B, and D would be instantiated with tag "strawberry".Is there some way to do this in DS without dropping down to the OSGiAPIs like ServiceTracker? I could probably do all of the above manuallysomehow, but I'd prefer not to have to.M
 
attxrnvn.datType: application/pgp-signatureName: attxrnvn.dat
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 



attccrq0.dat
Description: Binary data
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Gradle v.s. Build.bnd Versioning

2017-06-26 Thread BJ Hargrave
I assume you are using a Bnd workspace since you mention cnf/build.bnd. So you can set a version property in cnf/build.bnd for bundle versions which you can reference in Gradle. In a non-Bnd gradle sub-project, you can ask the workspace via rootProject.bndWorkspace which holds the Bnd Workspace object.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "M.J. Heuveling" Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Gradle v.s. Build.bnd VersioningDate: Sun, Jun 25, 2017 9:17 PM 
Hi all,I am struggling a little with versioning. Reason for this is I want create a karaf feature xml with the same version as the OSGI bundles I am creating for my project.As far as I know BND will not create a features XML for me does it?Anyway, I created a sub project with a gradle build file which will generate and publish the karaf feature xml file.I now want to give it the same version as what I have specified in my cnf/build.bnd file. How can I either set the version from gradle into the build.bnd or use the version from the build.bnd to set in my “non-bundle” sub project?Any best practices that could help me out here?Thanks,Misja___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Racing the BundleTracker

2017-06-01 Thread BJ Hargrave
From your description, it sounds like a reasonable amount of work to do synchronously to the event delivery.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mark Raynsford <list+org.o...@io7m.com>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: Re: [osgi-dev] Racing the BundleTrackerDate: Thu, Jun 1, 2017 6:34 AM 
On 2017-05-31T22:27:59 +0000"BJ Hargrave" <hargr...@us.ibm.com> wrote:>> The BundleTracker uses SynchronousBundleListener to be able to see all the BundleEvent types including RESOLVED. So your use of the BundleTracker must follow the advice for users of SynchronousBundleListener. See the doc for SynchronousBundleListener.Understood, thank you.> Since SynchronousBundleListener are synchronously called by the framework, it is important that SynchronousBundleListeners do not take a long time to return or attempt to manipulate the life cycle of the bundle whose BundleEvent is being delivered. This basically means that your BundleTracker should queue any long running work for another thread when an event occurs.Got it.In my case, the work performed is the following:1. Parse a very simple line-based declaration format. The format isdesigned to be extremely quick to parse, and I would be very surprisedif doing this took more than a millisecond.https://github.com/io7m/callisto/blob/feature/interfaces-sketch-00/com.io7m.callisto.resources.main/src/main/java/com/io7m/callisto/resources/main/CoResourceBundleParserProvider.java#L1192. For each file referenced in the parsed declaration above, check thatthe file actually exists in the bundle (Bundle#getResource) and recordthe name and URL in a map. The time taken to perform this step isobviously proportional to the number of resources declared and thespeed of access to entries in the bundle.3. Examine the wires of the bundle and check that each package (if any)listed by the Provide-Capability header has actually been declared inthe parsed file above. Any package that appears in theProvide-Capability header is marked as exported. This is entirelyCPU-bound and should be very quick to execute. It's basically a listtraversal and some HashMap retrievals and puts.I believe that the above work needs to be performed synchronously: Ifany errors occur in the above, they will be logged, and it's acceptableif resource lookups that occur afterwards yield errors. It wouldn't beacceptable, however, if all of the above work occurred without errorsand yet resource lookups failed anyway because they were taking placebefore the above work had completed.> In that case, you have all the usual race condition concerns. When doing the processing asynchronously to the synchronous event delivery, the bundle, since it is now RESOLVED, can be called by other bundles and can proceed in its lifecycle to be activated.>  > Anything you do synchronous to the event in the tracker will happen-before the bundle's life cycle can proceed since the SynchronousBundleListener must first return to allow that to happen.>  > So there is a tension between getting the work done synchronously to the event and doing too much work synchronous to the event. You will need to figure out the best tradeoff for you needs.Does the above seem like a reasonable tradeoff?It feels OK to me, but I'm nervous about there being lingering problemsthat don't show up until everything is in production (with many morebundle files and larger resource declaration files).M
 
attc5lhf.datType: application/pgp-signatureName: attc5lhf.dat
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 



attgbpw5.dat
Description: Binary data
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Racing the BundleTracker

2017-05-31 Thread BJ Hargrave
The BundleTracker uses SynchronousBundleListener to be able to see all the BundleEvent types including RESOLVED. So your use of the BundleTracker must follow the advice for users of SynchronousBundleListener. See the doc for SynchronousBundleListener.
 
Since SynchronousBundleListener are synchronously called by the framework, it is important that SynchronousBundleListeners do not take a long time to return or attempt to manipulate the life cycle of the bundle whose BundleEvent is being delivered. This basically means that your BundleTracker should queue any long running work for another thread when an event occurs.
 
In that case, you have all the usual race condition concerns. When doing the processing asynchronously to the synchronous event delivery, the bundle, since it is now RESOLVED, can be called by other bundles and can proceed in its lifecycle to be activated.
 
Anything you do synchronous to the event in the tracker will happen-before the bundle's life cycle can proceed since the SynchronousBundleListener must first return to allow that to happen.
 
So there is a tension between getting the work done synchronously to the event and doing too much work synchronous to the event. You will need to figure out the best tradeoff for you needs.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mark Raynsford Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Racing the BundleTrackerDate: Wed, May 31, 2017 5:44 PM 
Hello.So I now have what appears to be a working implementation of resourceregistration and resolution via the Extender pattern.Basically: A resource resolver service watches bundles with aBundleTracker as they reach the RESOLVED state. It examines each bundleand if that bundle has metadata that allows it to participate inresource handling, the resources and packages exported by the bundleare recorded.The service itself is trivial:https://github.com/io7m/callisto/blob/feature/interfaces-sketch-00/com.io7m.callisto.resources.main/src/main/java/com/io7m/callisto/resources/main/CoResourceResolver.javaThe service inserts bundles into a resource model, and removes bundlesfrom the model when they're uninstalled. The bulk of the code of themodel implements scanning of bundle headers and wires, and implementingthe logic to traverse wires to look up resources:https://github.com/io7m/callisto/blob/feature/interfaces-sketch-00/com.io7m.callisto.resources.main/src/main/java/com/io7m/callisto/resources/main/CoResourceModel.javaAs I've said, this all appears to work properly. I have quite extensiveunit tests that cover close to 100% of the code, and the semantics seemto be sane.The problem: I don't know if there are race conditions.If I install a bundle B that contains both resources and code, theBundleTracker will register those resources when the bundle reaches theRESOLVED state. I can (I think) assume that code in B (such as bundleactivators or immediate declarative services) will only execute whenthe bundle reaches the ACTIVE state, and therefore I believe that I canassume that the bundle tracker resource registration code for thebundle will happen before (in the concurrent happens-before sense) theactivator or services start executing.However, if some bundle C makes calls into code in B, and B tries toresolve one of its own resources... Do I have any guarantees that theresource resolution code in the BundleTracker will have completedbefore code in bundle B has any opportunity to call the resolverservice? I feel like I don't have that guarantee... Is there any way toget it?M
 
attit24d.datType: application/pgp-signatureName: attit24d.dat
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 



attilyud.dat
Description: Binary data
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Am I allowed to use OSGI-INF?

2017-05-30 Thread BJ Hargrave
You are free to use it. Try to avoid collisions with other users by using a subfolder with a unique name for you.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mark Raynsford Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Am I allowed to use OSGI-INF?Date: Tue, May 30, 2017 11:59 AM 
Both the core and compendium specs make references to this directory,but I can't find anything in either of them that states whether or notdevelopers are permitted to put their own metadata in this directory.Is the use of this directory reserved for services defined within thespec?I'd like to place a single file in this directory, the existence ofwhich my bundle tracker would use to determine that it should attemptto process the bundle in order to register resources.M
 
attvvaqi.datType: application/pgp-signatureName: attvvaqi.dat
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 



attlrkuv.dat
Description: Binary data
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Error reporting?

2017-05-25 Thread BJ Hargrave
What we have been doing lately in OSGi specs is for the extender/whiteboard impl bundle to register a runtime service which exposes a set of DTOs describing the state. See the ServiceComponentRuntime service for DS or the HttpServiceRuntime service for Http Whiteboard for examples.
 
With the DTOs, other parties can programmatically inspect the state.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: list+org.o...@io7m.comSent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: Re: [osgi-dev] Error reporting?Date: Thu, May 25, 2017 3:50 PM 
On 2017-05-25T19:35:52 +"BJ Hargrave" <hargr...@us.ibm.com> wrote:> Why not the BundleTracker code log to the LogService or even slf4j? Then any issues are in the log.> --The problem is that log messages are something that can be inspected byhumans, but aren't really much use programatically. I would definitelybe logging messages to a console somewhere, but I'd want failures to beobservable by other parts of the system so that they can act upon thefailures.M
 
attgidlg.datType: application/pgp-signatureName: attgidlg.dat
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 



attvg7it.dat
Description: Binary data
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Error reporting?

2017-05-25 Thread BJ Hargrave
Why not the BundleTracker code log to the LogService or even slf4j? Then any issues are in the log.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: list+org.o...@io7m.comSent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Error reporting?Date: Thu, May 25, 2017 3:18 PM 
Hello.I'm using a BundleTracker to instantiate services based on the contentsof specially-crafted bundle manifest entries. This is working nicely,but the one thing I don't really have is good error reporting: The codethat does the processing of bundles doesn't expose any services itselfand I don't really have any way to determine from elsewhere in theprogram if processing a bundle has failed. Is there a preferred designpattern for handling this?One good option would appear to be the Event Admin, but the downside tothis is that (unless I'm wrong), I'd need to use the core OSGi APIs tosubscribe to events. That's not a huge downside, but it does mean thatcode that otherwise has no interest in OSGi specifically has to dependon the APIs (unless I write some other abstraction that relaysevents to something like an rxjava Observable, and external code cansubscribe to this instead).Perhaps the right thing to do in this case is to simply publish errorsto the Event Admin and just assume that some other code will subscribeand take care of the errors?Any opinions? I appreciate that the question is a bit vague, but I'venot actually seen error reporting discussed in any literature.M
 
atttmime.datType: application/pgp-signatureName: atttmime.dat
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 



attfv2oj.dat
Description: Binary data
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] How to get the custom capabilities provided by a scoped subsystem ?

2017-05-16 Thread BJ Hargrave
I doubt it. The region bundles don't provide or require the capabilities themselves.
 
You will probably need to use the subsystem service to get the subsystem manifest and parse the headers yourself.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Cristiano Gavião Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] How to get the custom capabilities provided by a scoped subsystem ?Date: Tue, May 16, 2017 4:46 PM 
Hello OSGi experts,In a subsystem manifest we can declare provided capabilities using theheader "Provide-Capability:".I'm trying to get them using the bundle context from the subsystemservice (injected by DS):> List caps = pScopeSubsystem.getBundleContext()>                     .getBundle().adapt(BundleRevision.class)>                     .getCapabilities(null);>             for (Capability capability : caps) {>                 System.out.println("Cap: " + capability.toString());>             }Also tried BundleWiring:> BundleWiring bw = pKernelSubsystem.getBundleContext().getBundle()>                     .adapt(BundleWiring.class);> List capabilities = bw.getCapabilities(null);But the only capabilities that I was able to get are those:> Cap: osgi.wiring.bundle; bundle-version:Version="1.0.0";> osgi.wiring.bundle="org.osgi.service.subsystem.region.context.1"> Cap: osgi.wiring.host; bundle-version:Version="1.0.0";> osgi.wiring.host="org.osgi.service.subsystem.region.context.1"> Cap: osgi.identity;> osgi.identity="org.osgi.service.subsystem.region.context.1";> type="osgi.bundle"; version:Version="1.0.0"So, what is the way to get the custom capabilities declared for a scopesubsystem?many thanks,Cristiano___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Different conceptual version numbers for different forms of backwards compatibility?

2017-05-04 Thread BJ Hargrave
Again, see https://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html#jls-13.4.15.
 
If an API is released and then you change the API such that the return type is different, e.g. List to Collection, that is a binary incompatible change. The user of the API may expect it to be a List and invoke List methods on it.
 
You seem to be referring to covariant return types [1]. Binary compatibility does not care that the return type is covariant to the return type of the overridden method. If you change the return type, you break binary compatibility. It may be source compatible, but not binary compatible.
 
[1] https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#d5e11368
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Neil Bartlett <njbartl...@gmail.com>Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] Different conceptual version numbers for different forms of backwards compatibility?Date: Thu, May 4, 2017 4:51 PM 
BJ, is that still the case if we change the return type to a subtype of the original return type?
 
Ever since Java 5 it has been legal to implement an interface method and return a more specialised type than the interface demands… this would suggest a Minor API change (as long as we’re talking about a Provider Type interface).
 
Neil 

On 4 May 2017, at 15:02, BJ Hargrave <hargr...@us.ibm.com> wrote: 

This is not true from a binary compatibility point of view. See https://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html#jls-13.4.15. Changing the return type is the equivalent of deleting the old method and adding a new method. So it is in fact a binary incompatible change: A major change (method delete).
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Robert Munteanu <robert.munte...@gmail.com>Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] Different conceptual version numbers for different forms of backwards compatibility?Date: Thu, May 4, 2017 5:40 AM 
Hi Simon,On Wed, May 3, 2017 at 10:46 PM, Simon Spero <sesunc...@gmail.com> wrote:> I'm trying to clarify some thoughts in my own mind about how different kinds> of backwards compatibility interact with different kinds of version> numbering.>> There are at least two dimensions of backwards compatibility of relevance:> binary v. source, and provider v. consumer. Not all combinations are> important  to OSGI , but there do to seem to be some situations where> different use types suggest different potential version numbers (rather than> ranges).>> 1. Source compatible but binary incompatible changes.> In Java, the most commonly discussed  changes of this kind are specializing> a method return types (e.g. Collection  => List). I>> Under standard Java linkage rules, this will cause the methods to have> different signatures, making them incompatible, and requiring a major> version change.Not to detract from your main point, but method return types are notpart of the method's signature in Java.  https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.2Robert>> Older source can be compiled against the newer library without changes,> either to the source code, or a hypothetical range of return specialized> (RS) versions ; if the source were changed to use the more specialized> return type,  it would require the increasing the minimum RS  version> number. Thus, only a minor RS bump is required.>> Where this becomes interesting is if an OSGI  framework is extended to be> able to rewrite calls from older bundles to use the newer method signature> (quasi-recompiling). That would allow the newer package to satisfy more> constraints.>> 2. Provider vs. Consumer : default methods>> One of the primary use cases for default methods is to allow for new methods> to be added to interfaces without requiring changes to existing providers.> These might be convenience methods, be optional with reasonable defaults, or> be implementable using existing methods, with more performant> implementations possible but not mandatory.>> Early experiments handling default methods in OSGI using micro versions> showed that that  approach was not viable.>> A different approach might be to consider changes that only add default> methods to be neutral to invisible to an implementation of the previous> version of the class (excluding accidental signature clash).>> To packages calling the new methods there has been a minor increase;> similarly for packages 

Re: [osgi-dev] Different conceptual version numbers for different forms of backwards compatibility?

2017-05-04 Thread BJ Hargrave
This is not true from a binary compatibility point of view. See https://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html#jls-13.4.15. Changing the return type is the equivalent of deleting the old method and adding a new method. So it is in fact a binary incompatible change: A major change (method delete).
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Robert Munteanu Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Different conceptual version numbers for different forms of backwards compatibility?Date: Thu, May 4, 2017 5:40 AM 
Hi Simon,On Wed, May 3, 2017 at 10:46 PM, Simon Spero  wrote:> I'm trying to clarify some thoughts in my own mind about how different kinds> of backwards compatibility interact with different kinds of version> numbering.>> There are at least two dimensions of backwards compatibility of relevance:> binary v. source, and provider v. consumer. Not all combinations are> important  to OSGI , but there do to seem to be some situations where> different use types suggest different potential version numbers (rather than> ranges).>> 1. Source compatible but binary incompatible changes.> In Java, the most commonly discussed  changes of this kind are specializing> a method return types (e.g. Collection  => List). I>> Under standard Java linkage rules, this will cause the methods to have> different signatures, making them incompatible, and requiring a major> version change.Not to detract from your main point, but method return types are notpart of the method's signature in Java.  https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.2Robert>> Older source can be compiled against the newer library without changes,> either to the source code, or a hypothetical range of return specialized> (RS) versions ; if the source were changed to use the more specialized> return type,  it would require the increasing the minimum RS  version> number. Thus, only a minor RS bump is required.>> Where this becomes interesting is if an OSGI  framework is extended to be> able to rewrite calls from older bundles to use the newer method signature> (quasi-recompiling). That would allow the newer package to satisfy more> constraints.>> 2. Provider vs. Consumer : default methods>> One of the primary use cases for default methods is to allow for new methods> to be added to interfaces without requiring changes to existing providers.> These might be convenience methods, be optional with reasonable defaults, or> be implementable using existing methods, with more performant> implementations possible but not mandatory.>> Early experiments handling default methods in OSGI using micro versions> showed that that  approach was not viable.>> A different approach might be to consider changes that only add default> methods to be neutral to invisible to an implementation of the previous> version of the class (excluding accidental signature clash).>> To packages calling the new methods there has been a minor increase;> similarly for packages that implement one or more of the default methods.>> It seems to me as if there is a separate conceptual version number is> default aware, and  that need not have the minor bump required in the> primary version number.>> [I'm getting ready to run analysis over a mostly complete set of all bundles> in the index on the ibiblio maven central mirror, which is mostly complete> through 11/2016, where a bundle is defined to be any artifact that had a BSN> in the manifest when processed by the nexus (now maven) indexer.  I may> augment this set with output of any PAX wrap: URLs mentioned in Karaf> feature files.>> Some of my primary hypotheses is that the majority of these bundles do not> follow semantic versioning rules, and that some, but not all, of the set of> importing bundleswill have detectable possible linkage errors (e.g a> reference to a removed class or method).>> A secondary hypotheses is that applying recommended bndlib Baseline> renumbering to all (non qualified?)  versions in a sequence, mapping> external referencing import ranges to the appropriate rebased range will> result in a non-trivial set of unsatisfiable dependencies.>> There are other hypotheses that I'm trying to refine; what I'm hoping to> find are indica that can be used to predict  more reliable import ranges for> given maven artifact sequences, and to identify opportunities for safely> relaxing constraints.]>> Simon>> ___> OSGi Developer Mail List> osgi-dev@mail.osgi.org> https://mail.osgi.org/mailman/listinfo/osgi-dev--http://robert.muntea.nu/___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 


Re: [osgi-dev] Different conceptual version numbers for different forms of backwards compatibility?

2017-05-04 Thread BJ Hargrave
Semantic Versioning in OSGi is about binary compatibility and not source compatibility.
 
Adding a default method to an interface is always a minor version increment. For provider type interfaces, the consumer can depend upon the new method and must declare that by requiring the higher minor version. For consumer type interfaces, the consumer does not have to implement the default method, so it is not a major version change but the provider can depend upon the new method and must declare that by requiring the higher minor version. A micro version bump is insufficient as there is a new API which API users can depend upon being available.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Simon Spero Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Different conceptual version numbers for different forms of backwards compatibility?Date: Wed, May 3, 2017 6:45 PM I'm trying to clarify some thoughts in my own mind about how different kinds of backwards compatibility interact with different kinds of version numbering. 
 
There are at least two dimensions of backwards compatibility of relevance: binary v. source, and provider v. consumer. Not all combinations are important  to OSGI , but there do to seem to be some situations where different use types suggest different potential version numbers (rather than ranges). 
 
1. Source compatible but binary incompatible changes. 
In Java, the most commonly discussed  changes of this kind are specializing a method return types (e.g. Collection  => List). I 
 
Under standard Java linkage rules, this will cause the methods to have different signatures, making them incompatible, and requiring a major version change. 
 
Older source can be compiled against the newer library without changes, either to the source code, or a hypothetical range of return specialized  (RS) versions ; if the source were changed to use the more specialized return type,  it would require the increasing the minimum RS  version number. Thus, only a minor RS bump is required. 
 
Where this becomes interesting is if an OSGI  framework is extended to be able to rewrite calls from older bundles to use the newer method signature (quasi-recompiling). That would allow the newer package to satisfy more constraints. 
 
2. Provider vs. Consumer : default methods 
 
One of the primary use cases for default methods is to allow for new methods to be added to interfaces without requiring changes to existing providers. 
These might be convenience methods, be optional with reasonable defaults, or be implementable using existing methods, with more performant implementations possible but not mandatory. 
 
Early experiments handling default methods in OSGI using micro versions showed that that  approach was not viable. 
 
A different approach might be to consider changes that only add default methods to be neutral to invisible to an implementation of the previous version of the class (excluding accidental signature clash). 
 
To packages calling the new methods there has been a minor increase; similarly for packages that implement one or more of the default methods. 
 
It seems to me as if there is a separate conceptual version number is default aware, and  that need not have the minor bump required in the primary version number. 
 
[I'm getting ready to run analysis over a mostly complete set of all bundles in the index on the ibiblio maven central mirror, which is mostly complete through 11/2016, where a bundle is defined to be any artifact that had a BSN in the manifest when processed by the nexus (now maven) indexer.  I may augment this set with output of any PAX wrap: URLs mentioned in Karaf feature files.  
 
Some of my primary hypotheses is that the majority of these bundles do not follow semantic versioning rules, and that some, but not all, of the set of importing bundleswill have detectable possible linkage errors (e.g a reference to a removed class or method). 
 
A secondary hypotheses is that applying recommended bndlib Baseline renumbering to all (non qualified?)  versions in a sequence, mapping external referencing import ranges to the appropriate rebased range will result in a non-trivial set of unsatisfiable dependencies. 
 
There are other hypotheses that I'm trying to refine; what I'm hoping to find are indica that can be used to predict  more reliable import ranges for given maven artifact sequences, and to identify opportunities for safely relaxing constraints.] 
 
Simon
 
 
 
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] handling optional/dynamic imports in DS

2017-05-01 Thread BJ Hargrave
Also, the controller component should not register a service. "@Component(service={})". If you say "service={}" then you are "immediate=true".
 
Maybe you should make an enroute app note for this?
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Raymond Auge Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] handling optional/dynamic imports in DSDate: Mon, May 1, 2017 2:04 PM 
Good one Tim!
Oh, and I forgot to show that the "controller" component should be immediate otherwise it will never activate since nothing should "use" it. 
- Ray
 
On Mon, May 1, 2017 at 1:31 PM, Tim Ward  wrote:

For a dynamic import your controller could register a listener so that when a suitable package appears in the runtime your disabled component gets activated without needing to restart the controller.
 
Tim
Sent from my iPhone
On 1 May 2017, at 17:41, Raymond Auge  wrote: 
Hey All,I managed to find a relatively elegant solution to this with pure DS. Given a component using an optional/dynamic package(s):import com.liferay.demo.foo.Foo; // The optional package@Component(    enabled = false // disable so that DS ignores it)public class OptionalPackageConsumer implements Foo {...} A controller is created which does the classloader check:@Componentpublic class OptionalPackageConsumerStarter {   @Activate    void activate(ComponentContext componentContext) {        try {            Class.forName(com.liferay.demo.foo.Foo.class.getName());            componentContext.enableComponent(OptionalPackageConsumer.class.getName());        }        catch (Throwable t) {            _log.warn("Could not find {}", t.getMessage());        }    }} If successful, the component is enabled, otherwise, don't! - Ray

 
 
On Thu, Apr 27, 2017 at 1:48 AM, Fauth Dirk (AA-AS/EIS2-EU)  wrote:

I totally agree that a clean solution would be to extract the service in another bundle with a non optional dependency, as this avoids any runtime issues at the beginning by not starting the bundle. Will think about that for the Platform Runtime after Oxygen, as such a change is not allowed at the current state of the development.
 
Nevertheless I created https://bugs.eclipse.org/bugs/show_bug.cgi?id=515873 because the NPE is misleading. Whether an exception should be shown or not is discussable. Felix is not showing anything at all, which also makes it hard to find the reason why the service is not activated. Therefore logging the exception is perfectly fine in my opinion. But the NPE when using the field strategy looks incorrect to me. It doesn’t help anyway to find the real cause.
 
Mit freundlichen Grüßen / Best regardsDirk FauthAutomotive Service Solutions, ESI application (AA-AS/EIS2-EU)Robert Bosch GmbH | Postfach 11 29 | 73201 Plochingen |  GERMANY |  www.bosch.comTel. +49(7153)666-1155 | dirk.fa...@de.bosch.com Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Dr. Volkmar Denner,Prof. Dr. Stefan Asenkerschbaumer, Dr. Rolf Bulander, Dr. Stefan Hartung, Dr. Markus Heyn, Dr. Dirk Hoheisel,Christoph Kübel, Uwe Raschke, Peter Tyroller  
Von: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-bounces@mail.osgi.org] Im Auftrag von Thomas WatsonGesendet: Mittwoch, 26. April 2017 14:38An: osgi-dev@mail.osgi.org
Betreff: Re: [osgi-dev] handling optional/dynamic imports in DS
 
 
By Private-Package Peter means he packages the optional package internally in the bundle but also optionally imports it so that if it is resolved to an external provider then that will be used over the internal copy.  The Private-Package header in bnd will instruct bnd to package the package internally in the jar.
 
Personally, if I had this scenario I would extract the service component out to a new bundle that has a non-optional import for the package and be done with the magic of dynamic or optional imports.  Or if that is not what you want I would make it a fragment the that has a non-optional import.  That way the bundle with the service component cannot possibly provide its service component until it is resolved.
 
I'm not sure I follow your example that is failing in equinox, but open a bug if you find it is an Equinox bug.
Tom 
 
 
- Original message -From: "Fauth Dirk (AA-AS/EIS2-EU)" Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] handling optional/dynamic imports in DSDate: Wed, Apr 26, 2017 3:02 AM 
Interestingly this works fine when running from Bndtools with Felix.
 
If I try the same with Equinox for projects created with PDE I get a NullPointerException. IIRC Private-Package is 

Re: [osgi-dev] handling optional/dynamic imports in DS

2017-04-25 Thread BJ Hargrave
So why isn't this just the case already? SCR processes the XML, cannot load the impl class and logs that in the log. End of story. When bundle resolves again later and can access the class, when SCR processes the XML, it can load the impl class and thus the component is good to go.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Raymond Auge Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] handling optional/dynamic imports in DSDate: Tue, Apr 25, 2017 6:20 PM 
 
 
On Tue, Apr 25, 2017 at 6:16 PM, Christian Schneider  wrote:

Not sure if that is possible...I think it would be awesome if the DS runtime could try to load the component class and if it fails because of an unwired packageit could simply choose to not instantiate the component. It could also report this problem when you look into the components from the shell.When the bundle is then refreshed later it could try the same again and maybe succeed if the package is wired now.The big advantage would be that the user would not have to code anything to make this work.Currently handling optional imports using an Activator is quite difficult and error prone.Does that make sense?
 
I totally agree! 
- Ray
 
Christian
On 26.04.2017 00:06, Raymond Auge wrote:
You're not far off,but clearly the component could not be implementing the missing package... Let's say we have an API: interface com.foo.Provider {
    public void provide();
} a bundle wants to provide an implementation of this API: @Componentclass FancyProviderImpl implements com.foo.Provider { ... } However the goal of FancyProviderImpl is to deliver functionality by using fancy-lib.jar which is a second bundle. e.g.import fancy.lib.Thing;@Componentclass FancyProviderImpl implements com.foo.Provider {    public void provide() {    new Thing().doSomethingFancy();

    }} 
I'd like for the bundle containing FancyProviderImpl to have an optional import on `fancy.lib`, and not blow up when `fancy-lib.jar` is not deployed. Exactly the same scenario you mentioned with configAdmin, metatype and SCR. 
I hope that makes sense,
- Ray
 
 
On Tue, Apr 25, 2017 at 5:51 PM, Felix Meschberger  wrote:

Hi Ray
 
I am not sure, I understand the question.
 
Are you asking that the component dynamically decides to register as a certain service depending on the whether a certain package is wired ?
 
I think that does not work as the component implements an interface which is the service name and the component class can only be loaded if the class object representing the interface being implemented is accessible, otherwise a Linkage error occurrs.
 
Or may I am on the wrong track alltogether.
 
Regards 
Felix 
 
Am 25.04.2017 um 14:46 schrieb Raymond Auge : 

Thank you Felix, I agree and understand all of what you are saying. However, what I'm wondering though is if anyone has come up with a design pattern where a DS component can determine programmatically whether it (or a peer component it controls) should be provided as a service based on the check for some optional package. Sincerely,- Ray
 
On Tue, Apr 25, 2017 at 5:33 PM, Felix Meschberger   wrote:

Hi
 
You mean dynamic imports due to optional dependencies ?
 
I think the key is to limit them. If I remember correctly I have (or had) some of this in the Apache Felix SCR implementation around the Metatype and Configuration Admin dependencies.
 
What I do is I hand-craft a DynamicImport-Package statement for the exact package along with the packages import version range. Then, unless the service is provided, the package may not be resolved.
 
I generally also have fields, but as long as I don’t access that field other than checking for null, the dependency is not needed either.
 
This works great, but I try to reduce such uses to the absolute minimum because it involves manual work.
 
Hope this helps
 
Regards
Felix
 
Am 25.04.2017 um 14:10 schrieb Raymond Auge :
I'm wondering if there is a reasonable model for handling optional or dynamic package imports in DS. While optionality at the package level is not an ideal model, sometimes it can't be avoided.I'd like to know if others have come across a "reasonable" way to model this in DS.
 
Sincerely,
--
Raymond Augé (@rotty3000)
Senior Software Architect Liferay, Inc. (@Liferay)Board Member & EEG Co-Chair,  OSGi Alliance (@OSGiAlliance)___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev--
Raymond Augé (@rotty3000)
Senior Software 

Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?

2017-04-20 Thread BJ Hargrave
When DS registers your component as a service, it already registers its own object implementing ServiceFactory. This is necessary to register the service while still allowing delayed activation of your component. So DS's ServiceFactory object is called by the framework when someone gets the service and then DS will instantiate and activate your service component. How many times this is done is controlled by scope of the component: singleton, bundle, prototype.
 
The basic point is that DS must be in charge of constructing and activating component instances and so your component implemention ServiceFactory does not work with that. With plans to support constructor injection in DS 1.4, this is even more important to the DS component model.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Julian Sedding Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Allow registering a (Prototype)ServiceFactory via DS?Date: Thu, Apr 20, 2017 9:39 AM 
Hi TimThat's an interesting approach! I hadn't considered using DS buthandling the service registration myself.To me it would have felt consistent if registering a ServiceFactory asa service using DS had just worked. Next to controlling the scope(singleton, bundle, prototype) of a service,  a ServiceFactory seemssuitable to creating service objects by means other than their defaultconstructor. Thus, supporting ServiceFactories in DS would make itvery easy to provide OSGi-glue for arbitrary Java classes that arethemselves unaware of OSGi.Of course there is a trade-off between the usefulness of a feature andbloating the spec. And I'll leave this decision with you guys.RegardsJulianOn Thu, Apr 20, 2017 at 12:35 PM, Timothy Ward  wrote:> DS isn’t intended to solve every single use case, rather to make common use cases simple to write and understand. In this case what you want is more advanced, and unlikely to make it into DS as a natively supported pattern. Given that you’re already tied to the core OSGi API (ServiceFactory) then registering the service programatically would still let DS help you with config and service injection.>>> @Component(>    // Do not let DS provide the service>    service = {},>    configurationPolicy = ConfigurationPolicy.REQUIRE> )> public class FooServiceFactory implements ServiceFactory {>>    @Reference // provides FooBuilder instances that are pre-configured via OSGi>    private FooBuilderFactory fooBuilderFactory;>>    private ServiceRegistration reg;>>   @Activate>   void start(BundleContext ctx, Map props, Config config) {>       reg = ctx.registerService(Foo.class.getName(), this, props);>   }>>   @Deactivate>   void stop() {>       reg.unregister();>   }>>    @Override>    public Foo getService() {>        FooBuilder fooBuilder = fooBuilderFactory.builder();>        applyConfiguration(fooBuilder);>        return fooBuilder.build();>    }>>    private void applyConfiguration(FooBuilder fooBuilder) {>        // apply OSGi configuration to FooBuilder object>    }>>    ... // ungetService omitted for brevity>> }>>> Regards,>> Tim On 20 Apr 2017, at 11:11, Julian Sedding  wrote: Hi Timothy Thanks for your reply. Using delegation works, I currently use it to>> solve my use-case. However, compared to implementing a ServiceFactory, delegation adds>> some overhead: - delegation needs to be implemented, which is trivial, but noisy if>> there are lots of methods that need delegating>> - by delegating, my implementation becomes a "provider" of Foo, rather>> than a "consumer", making my bundle more susceptible to changes in>> Foo's API>> - also: delegation is not possible if Foo is a final class I brought up this topic in order to (a) confirm that my desired>> approach is indeed not possible at the moment and (b) to see if adding>> support for registering custom ServiceFactory implementations via DS>> could be a desirable enhancement for the spec. Regards>> Julian>> On Thu, Apr 20, 2017 at 11:22 AM, Timothy Ward  wrote:>>> Have you not considered the following:> @Component(configurationPolicy = ConfigurationPolicy.REQUIRE,>>>    scope = ServiceScope.BUNDLE)>>> public class FooImpl implements Foo {>>   public @interface Config {>>>      // Config definition in here>>>   }>>   @Reference>>>   private FooBuilderFactory fooBuilderFactory;>>   private Foo delegate;>>   @Activate>>>   void start(Config config) {>>>       FooBuilder fooBuilder = fooBuilderFactory.builder();>>>       applyConfiguration(fooBuilder, config);>>>       delegate = fooBuilder.build();>>>   }>>   // Deactivation and Foo delegation methods go here>>>   …>>> }>> Regards,>> Tim>>> On 20 Apr 2017, at 09:30, 

Re: [osgi-dev] Configuring reference.cardinality.minimum / reference.target via Metatypes

2017-04-13 Thread BJ Hargrave
Yes. You need to use the correct property name: .cardinality.minimum. See 112.6.2.2 in the DS spec.
 
 
@ObjectClassDefinition
@interface MyConfiguration {
    String name;
    // this will make a property named stuff.cardinality.minimum
    // which is the minimum cardinality for the reference named "stuff".
    int stuff_cardinality_minimum default 3;
}
 
@Designate(ocd = MyConfiguration)
@Component(configurationPid = 'configurable')
class ConfigurableTest {
  @Reference(
    cardinality = ReferenceCardinality.MULTIPLE,
    policy = ReferencePolicy.DYNAMIC,
    policyOption = ReferencePolicyOption.GREEDY
  )
volatile List stuff
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Thomas Driessen Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Configuring reference.cardinality.minimum / reference.target via MetatypesDate: Thu, Apr 13, 2017 9:24 AM 
Hi,
 
I was wondering if one can configure the @Reference cardinality.minimum property of a service vie Metatypes somehow?
 
In my example (written in Xtend) I'd like to configure the minimum cardinality of 'stuff'. So is there a magic property name/pattern (like in the commented code below) that I can use in MyConfiguration  in order to achieve that?
 
@ObjectClassDefinition
annotation MyConfiguration{
        String name
        // String stuffCardinalityMinimum
}
 
@Designate(ocd = MyConfiguration)
@Component(configurationPid = 'configurable')
class ConfigurableTest{
@Reference(
cardinality = ReferenceCardinality.MULTIPLE,
policy = ReferencePolicy.DYNAMIC,
policyOption = ReferencePolicyOption.GREEDY
)
volatile List stuff
 
@Activate
private def void activate(MyConfiguration config){
println('''Activated: «config.name»''')
}
 
@Modified
private def void update(MyConfiguration config){
println('''Updated: «config.name»''')
}
 
@Deactivate
private def void deactivate(){
println('''Deactivated''')
}
}
 
@Component
class Stuff implements IStuff{}
 
interface IStuff{}
 
Any advice is appreciated :)
 
Kind regards,
Thomas
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Log Service Specification Version 1.4 doubt

2017-04-07 Thread BJ Hargrave
If you have any comments on and RFC or spec draft, please make them in the OSGi public bugzilla system as requested in the documents. Thanks.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Simon Spero Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Log Service Specification Version 1.4 doubtDate: Fri, Apr 7, 2017 11:41 AM 
On Apr 7, 2017 5:58 AM, "Neil Bartlett"  wrote:

The draft specification repeatedly mentions SLF4J and supports it explicitly. Log4j is an implementation that can be used behind SLF4J.
 
So… what’s missing?
 
I have some actual comments (from  RFC) 
 
1. Deprecation annotations  on LogListener and LogReaderService (also class @Deprecated on LogService). 
 
2. Marker interface  (and appropriate methods on Logger) 
 
3. On Logger, add generic isEnabled(LogLevel) and log(LogLevel, Blah blah) methods. Hate that this isn't exposed by slf4j api. 
 
4. Allow non-fqdn Logger names. Could support hierarchy,  or could force parent to ROOT. 
 
5. Allow Loggers to be selected using a filter.
 
6. Provide specification for pre-bundle logging for frameworks. (maybe) 
 
Simon
 
P.S. 
  Any estimate of what percentage of hosted fragments are guests of slf4j? 
 
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Log Service Specification Version 1.4 doubt

2017-04-07 Thread BJ Hargrave
The spec wont be "codifying SLF4J". It will work with slf4j as shows in the github project and uses principles from slf4j.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Matt Sicker <boa...@gmail.com>Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] Log Service Specification Version 1.4 doubtDate: Fri, Apr 7, 2017 11:06 AM 
Log4j is also a logging API besides an implementation with numerous advantages to SLF4J. By codifying SLF4J in the standard, I feel that this unnecessarily limits the log service API.
 
On 7 April 2017 at 04:58, Neil Bartlett <njbartl...@gmail.com> wrote:

The draft specification repeatedly mentions SLF4J and supports it explicitly. Log4j is an implementation that can be used behind SLF4J.
 
So… what’s missing?
 
On 6 Apr 2017, at 22:25, Matt Sicker <boa...@gmail.com> wrote: 

I'm honestly surprised that there was no collaboration between SLF4J or Log4j about this considering most implementations of the service will end up delegating to Log4j2 or Logback most likely (see pax-logging for example).
 
On 6 April 2017 at 13:58, BJ Hargrave <hargr...@us.ibm.com> wrote:

It is indeed a service. The spec writing for these changes are not in the draft spec so you can see https://github.com/osgi/design/blob/master/rfcs/rfc0219/rfc-0219-LogService-Update.pdf for some more detail/background on the change.
 
 
Also see https://github.com/osgi/slf4j-osgi which holds an slf4j binding to the new Log Service.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Matt Sicker <boa...@gmail.com>Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List <osgi-dev@mail.osgi.org>Cc:Subject: Re: [osgi-dev] Log Service Specification Version 1.4 doubtDate: Thu, Apr 6, 2017 2:11 PM 
As long as LoggerFactory is a service and not a static singleton like in SLF4J and Log4j2, then the API makes sense in an OSGi context. If it's yet another static factory, then I'd promote the use of Log4j2 instead as we don't need yet another logging facade.
 
On 6 April 2017 at 12:27, Cristiano Gavião <cvgav...@gmail.com> wrote:

Hello,I was reading today the early draft of compendium 7.0.0.I saw two interfaces that caught my attention: LoggerFactory and Logger.could someone explain me the idea behind them? why not importing/extending interfaces from org.slf4j.api instead?If I understood it right, LoggerFactory is aimed to be used as a service, but I wondering, it would be possible to obtain a Logger from the factory statically as well as we do when using sfl4j/logback on non-service classes?thanks,Cristiano___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 

 --

Matt Sicker <boa...@gmail.com>
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 ___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 

 --

Matt Sicker <boa...@gmail.com>___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 

 --

Matt Sicker <boa...@gmail.com>
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Log Service Specification Version 1.4 doubt

2017-04-06 Thread BJ Hargrave
It is indeed a service. The spec writing for these changes are not in the draft spec so you can see https://github.com/osgi/design/blob/master/rfcs/rfc0219/rfc-0219-LogService-Update.pdf for some more detail/background on the change.
 
 
Also see https://github.com/osgi/slf4j-osgi which holds an slf4j binding to the new Log Service.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Matt Sicker Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Log Service Specification Version 1.4 doubtDate: Thu, Apr 6, 2017 2:11 PM 
As long as LoggerFactory is a service and not a static singleton like in SLF4J and Log4j2, then the API makes sense in an OSGi context. If it's yet another static factory, then I'd promote the use of Log4j2 instead as we don't need yet another logging facade.
 
On 6 April 2017 at 12:27, Cristiano Gavião  wrote:

Hello,I was reading today the early draft of compendium 7.0.0.I saw two interfaces that caught my attention: LoggerFactory and Logger.could someone explain me the idea behind them? why not importing/extending interfaces from org.slf4j.api instead?If I understood it right, LoggerFactory is aimed to be used as a service, but I wondering, it would be possible to obtain a Logger from the factory statically as well as we do when using sfl4j/logback on non-service classes?thanks,Cristiano___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 

 --

Matt Sicker 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Order of injected services into a Collection/List field

2017-03-09 Thread BJ Hargrave
The ordering is the same regardless of whether the reference is static or dynamic.
 
I have clarified the text in 112.3.8.1 for this in the DS 1.4 spec.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Konrad Windszus Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Order of injected services into a Collection/List fieldDate: Fri, Mar 3, 2017 2:42 AM 
Hi,DS 1.3 added field injection and now supports Collections/Lists. Unfortunately it is only specified (in OSGi R6 Comp, §112.3.8.1) how those are ordered in case of dynamic references. What about having a static reference with multiple cardinality?I fail to see the according spec about the ordering of these.Is this an oversight on my side, or is this just missing from the spec?Can I assume that those are ordered as well according to ServiceReference.compareTo(...)?Thanks,Konrad___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Updating service properties at runtime

2017-03-02 Thread BJ Hargrave
BTW, osgi.annotation does not contain DS annotations.
 
DS annotations are in osgi.cmpn and org.osgi.service.component.annotations.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Thomas Driessen" Sent by: osgi-dev-boun...@mail.osgi.orgTo: "Dirk Fauth" , "OSGi Developer Mail List" Cc:Subject: Re: [osgi-dev] Updating service properties at runtimeDate: Thu, Mar 2, 2017 8:34 AM 
I am using the annotations osgi.annotations 6.0.1. 
My Service looks like this:
 
@Component
public class ServiceAImpl implements IServiceA{
    ...
 
    @Reference(cardinality = ReferenceCardinality.Multiple)
    public synchronized void addServiceB(IServiceB service){
        ...
}
}
 
and I was just wondering if there is the possibility to write something like
@Reference(cardinality = ReferenceCardinality, Multiple, minimumCardinality = 4)
 
But Jens Kübler already wrote that I would have to add this information manually to the generated XML.
 
Maybe the following is possible then?
 
@Component(
    property = "ServiceB.cardinality.minimum=4")

public class ServiceAImpl implements IServiceA{
    ...
}
 
Kind regards,
Thomas
 
-- Originalnachricht --
Von: "Dirk Fauth" 
An: "Thomas Driessen" ; "OSGi Developer Mail List" 
Gesendet: 02.03.2017 14:25:06
Betreff: Re: [osgi-dev] Updating service properties at runtime
 
Well if you use Bndtools you should be able to use the annotations. Maybe you use the wrong annotations in the configuration? 
 
Am 02.03.2017 2:18 PM schrieb "Thomas Driessen" :

I'm using the version 5.6.1 of Felix as osgi framework if that does matter?
Eclipse is only used as IDE in combination with bndtools 4
 
Thomas
 
-- Originalnachricht --
Von: "Dirk Fauth" 
An: "Thomas Driessen" ; "OSGi Developer Mail List" 
Gesendet: 02.03.2017 14:13:42
Betreff: Re: [osgi-dev] Updating service properties at runtime
 
Actually Oxygen in its current development state contains Felix SCR,  so it supports DS 1.3 under the hood. 
 
For the DS 1.3 annotations there is a Gerrit patch available that needs to be verified. I'm currently looking at this so it can be part of Eclipse Oxygen. 
 
Minimum cardinality is a DS 1.3 feature so it will not work with Eclipse in its current release state. 
 
Am 02.03.2017 2:07 PM schrieb "Thomas Driessen" :
Thank you very much! 
 
-- Originalnachricht --
Von: "Kübler, Jens" 
An: "Thomas Driessen" ; "OSGi Developer Mail List" 
Gesendet: 02.03.2017 14:05:27
Betreff: RE: [osgi-dev] Updating service properties at runtime
 
Eclipse does only support the DS 1.2 spec and this was added in a later version.
if you are running in a DS 1.3 environment you have to add it manually to the xml and cannot use the annotations.
Discussion is under way to add the functionality in Eclipse 4.7
 
Kind Regards
Jens
 
From: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-bounces@mail.osgi.org] On Behalf Of Thomas DriessenSent: Thursday, March 02, 2017 2:01 PMTo: OSGi Developer Mail ListSubject: Re: [osgi-dev] Updating service properties at runtime
 
Thank you both for your answers.
 
Is it possible to directly annotate a reference with the minimum cardinality, or do I have to do this via ConfigurationAdmin?
In Eclipse autocomplete only shows the property cardinality which expects a ReferenceCardinality (OPTIONAL, MANDATORY, etc.)
112.6.2.2 in the specification also only talks about how to adress this property via ConfigurationAdmin.
 
Kind regards,
Thomas
 
-- Originalnachricht --
Von: "Dirk Fauth" 
An: "OSGi Developer Mail List" 
Gesendet: 02.03.2017 13:37:21
Betreff: Re: [osgi-dev] Updating service properties at runtime
 
You can find an example in one of my blog posts. 
 
http://blog.vogella.com/2016/09/26/configuring-osgi-declarative-services/
 
At the bottom the usage of the minimum cardinality reference property is shown. 
 
Am 02.03.2017 1:07 PM schrieb "Carsten Ziegeler" :
You can do this with DS, have a look at section 112.6.2.2 MinimumCardinality PropertyRegardsCarstenThomas Driessen wrote> Hi,>> I currently have the following usecase:>> Service A depends on Service B> Service B depends on 4x Service C> Service A may only become active when Service B has exactly 4x Service> C, thus becoming active itself.>> I'm using declarative services which only support 0-*, 1-*, 0-1 and> exactly 1 dependencies between services.>> One idea I came up with, was to count the C services in B's setC(C c)> method 

Re: [osgi-dev] Updating service properties at runtime

2017-03-02 Thread BJ Hargrave
Sure you can add it through the annotations. It is just a component property.
 
@Component(property="C.cardinality.minimum=4")
 
where C is the name of the reference to serviceC.
 
@Reference(name="C")
void setC(C c)
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Kübler,Jens" Sent by: osgi-dev-boun...@mail.osgi.orgTo: Thomas Driessen , OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Updating service properties at runtimeDate: Thu, Mar 2, 2017 8:05 AM  
Eclipse does only support the DS 1.2 spec and this was added in a later version.
if you are running in a DS 1.3 environment you have to add it manually to the xml and cannot use the annotations.
Discussion is under way to add the functionality in Eclipse 4.7
 
Kind Regards
Jens
 
From: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] On Behalf Of Thomas DriessenSent: Thursday, March 02, 2017 2:01 PMTo: OSGi Developer Mail ListSubject: Re: [osgi-dev] Updating service properties at runtime
 
Thank you both for your answers.
 
Is it possible to directly annotate a reference with the minimum cardinality, or do I have to do this via ConfigurationAdmin?
In Eclipse autocomplete only shows the property cardinality which expects a ReferenceCardinality (OPTIONAL, MANDATORY, etc.)
112.6.2.2 in the specification also only talks about how to adress this property via ConfigurationAdmin.
 
Kind regards,
Thomas
 
-- Originalnachricht --
Von: "Dirk Fauth" 
An: "OSGi Developer Mail List" 
Gesendet: 02.03.2017 13:37:21
Betreff: Re: [osgi-dev] Updating service properties at runtime
 
You can find an example in one of my blog posts. 
 
http://blog.vogella.com/2016/09/26/configuring-osgi-declarative-services/
 
At the bottom the usage of the minimum cardinality reference property is shown. 
 
Am 02.03.2017 1:07 PM schrieb "Carsten Ziegeler" :
You can do this with DS, have a look at section 112.6.2.2 MinimumCardinality PropertyRegardsCarstenThomas Driessen wrote> Hi,>> I currently have the following usecase:>> Service A depends on Service B> Service B depends on 4x Service C> Service A may only become active when Service B has exactly 4x Service> C, thus becoming active itself.>> I'm using declarative services which only support 0-*, 1-*, 0-1 and> exactly 1 dependencies between services.>> One idea I came up with, was to count the C services in B's setC(C c)> method and, on reaching the count of 4, setting a specific property on B> (e.g. weirdUsecaseIsActive = true) and let A's reference to B filter> with a corresponding target filter.>> I know this sound like a dirty hack, but I did not found any better> solutions.>> Therefore, my questions are:> 1) Is there a better solution for my usecase?> 2) If not: How do I update properties of a service at runtime?>> Kind regards,> Thomas>>> ___> OSGi Developer Mail List> osgi-dev@mail.osgi.org> https://mail.osgi.org/mailman/listinfo/osgi-dev>--Carsten ZiegelerAdobe Research Switzerlandcziege...@apache.org___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Deriving Java 9 module descriptors from OSGimetadata?

2017-02-27 Thread BJ Hargrave
Yes, this is how I think it will work best: a tooling story. But Java 9 modules are not a finalized design yet, so the Bnd devs are not looking at anything to do this yet.
 
If you have ideas/opinions of this topic of Bnd changes, you should take it to the bndtools-users@ mail list.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Matt Sicker Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] Deriving Java 9 module descriptors from OSGi metadata?Date: Sat, Feb 25, 2017 4:58 PM 
Perhaps bnd could be enhanced to handle it, but I'd imagine you'd just have two build plugins generating metadata from the same project model.
 
On 25 February 2017 at 13:26,  wrote:

Hello!I'm curious if anyone's given any thought to deriving Java 9 moduledescriptors from OSGi manifests.Right now, in a pre-JDK9 world, it's standard practice to produce jarfiles that are OSGi bundles when used in an OSGi context, and ordinarypile-of-classes jar files when used on the Java classpath. In otherwords, builds generally produce a single jar file that:  - Works as an OSGi bundle when used in an OSGi context  - Works as an ordinary jar when used on the classpathHowever, when JDK9 appears, it introduces the concept of modular jars.Those work somewhat differently and require the addition of a moduledescriptor in the JAR file (assuming that "automatic modules" are notused). In other words, a build should (assuming that compatibility witholder JVMs is desirable) produce a jar file that:  - Works as an OSGi bundle when used in an OSGi context  - Works as a modular jar when used on the module path in Java >= 9  - Works as an ordinary jar when used on the traditional classpathGiven that the information expressible in a Java 9 module descriptorseems to be a subset of that defined in OSGi manifests, it seems likeit would be possible if not necessarily easy to derive a Java 9 moduledescriptor from data given in OSGi manifests as part of the buildprocess. I personally am not looking forward to having to maintaintwo very nearly if not completely identical sets of metadata regardingthe imports and exports of packages.Anyone looked at this?M___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 

 --

Matt Sicker 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Components are not started, although marked with immediate=true

2017-02-17 Thread BJ Hargrave
Seems like they should all be active. You may need to check with the felix-dev list about Felix SCR's handling of this.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Thomas Driessen" Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: [osgi-dev] Components are not started, although marked with immediate=trueDate: Fri, Feb 17, 2017 2:46 PM  Hi,
 
I have a problem with immediate services and hoped that you guys maybe can help.
 
I'm currently trying to implement several services within one bundle (see below for code).
I have set all of them to be immediate (by immediate=true), but still, when I start the OSGi container with my bundle in it, only Con1, InDataPort1 and OutDataPort1 are active. The rest is satisfied but not active according to felix.scr console output:
 
g! listBundleId Component Name Default State   Component Id State      PIDs (Factory PID)[  10]   test.Con1  enabled   [   0] [active      ][  10]   test.InDataPort1  enabled   [   1] [active      ][  10]   test.OutDataPort1  enabled   [   2] [active      ][  10]   test.Process1  enabled   [   3] [satisfied   ][  10]   test.Thread1_1  enabled   [   4] [satisfied   ][  10]   test.Thread1_2  enabled   [   5] [satisfied   ] 
 
Am I doing something wrong?
I assumed that all services should be started as soon as they are satisfied.
 
Any advice is highly appreciated.
 
Kind regards,
Thomas
 
@Component(immediate = true, service = IProcess.class, property = "de.uniaugsburg.smds.aadl2osgi.component.uid=test.Process1")public class Process1 implements IProcess {  
 @Reference(target = "(uid=test.Thread1_1)") private volatile IPeriodicThread thread1;  @Reference(target = "(uid=test.Thread1_2)") private volatile IPeriodicThread thread2;}
 
 
@Component(service = IPeriodicThread.class, property = "de.uniaugsburg.smds.aadl2osgi.component.uid=test.Thread1_1", immediate = true)public class Thread1_1 implements IPeriodicThread {   @Reference(target = "(uid=test.OutDataPort1)") private volatile IOutDataPort outport;  
 @Activate public void initialize_FW() {   init(); }  @Deactivate public void finalize_FW() {   deinit(); }
}
 
 
@Component(service = IPeriodicThread.class, property = "de.uniaugsburg.smds.aadl2osgi.component.uid=test.Thread1_2", immediate = true)public class Thread1_2 implements IPeriodicThread {   @Reference(target = "(uid=test.InDataPort1)") private volatile IOutDataPort outport;  
 @Activate public void initialize_FW() {   init(); }  @Deactivate public void finalize_FW() {   deinit(); }
}
 
 
@Component(service = IOutDataPort.class, property = "uid=test.OutDataPort1", immediate = true)public class OutDataPort1 implements IOutDataPort { @Reference(target = "(target=test.OutDataPort1)", cardinality = ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY) private volatile IPortConnection incomingPortConnections;  private volatile Set outgoingPortConnections = new ConcurrentSkipListSet();  @Reference(target = "(source=test.OutDataPort1)", cardinality = ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY) public void addOutgoingPortConnection(final IPortConnection con) {   outgoingPortConnections.add(con); }  public void removeOutgoingPortConnection(final IPortConnection con) {   outgoingPortConnections.remove(con); }}
 
 
@Component(service = IInDataPort.class, property = "uid=test.InDataPort1", immediate = true)@SuppressWarnings("all")public class InDataPort1 implements IInDataPort { @Reference(target = "(target=test.InDataPort1)", cardinality = ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY) private volatile IPortConnection incomingPortConnections;  private volatile Set outgoingPortConnections = new ConcurrentSkipListSet();  @Reference(target = "(source=test.InDataPort1)", cardinality = ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY) public void addOutgoingPortConnection(final IPortConnection con) {   outgoingPortConnections.add(con); }  public void removeOutgoingPortConnection(final IPortConnection con) {   outgoingPortConnections.remove(con); }}
 
 
@Component(service = IPortConnection.class, property = { "source=test.OutDataPort1", "target=test.InDataPort1" }, immediate = true)public class Con1 implements IPortConnection { @Reference(cardinality = ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY, target = "(uid=test.OutDataPort1)") private volatile IOutDataPort source;  @Reference(cardinality = ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY, target = "(uid=test.InDataPort1)") private volatile IInDataPort target;}
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 


Re: [osgi-dev] osgi broker bundle

2017-02-17 Thread BJ Hargrave
Sounds like it wants Blueprint. Maybe just the API package, maybe the implementation. I would not expect a Blueprint implementation to run in jre embedded.
 
Have you looked at https://projects.eclipse.org/projects/technology.mosquitto ?
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Mestiri Meher Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] osgi broker bundleDate: Fri, Feb 17, 2017 11:29 AM 
Hi guys,
 
I'm looking on how deploying an MQTT broker into an osgi environment.
 
I'm running my osgi container in an embedded environment.
 
I tried installing apache Karaf as it already has the ActiveMQ broker integration easy, but i was not able to install it as it needs some junit libraries that does not comply with the jre embedded.
 
The other solution I'm thinking of is installing the ActiveMQ broker against Felix.
 
I found in an mvn repo an osgi bundle for the activeMQ but it needs its dependencies.
 
So I tried adding them as bundles but I faced an issue right now because when I start that bundle it asks for a dependency that I can't find it.
 
->  Unable to resolve org.apache.activemq.activemq-osgi version=5.14.3:
   missing requirement org.osgi.service.blueprint; version=[1.0.0,2.0.0)]
 
Do you have an idea on how I have to proceed ?
 
Thanks in advance :)
Meher
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] ServiceComponentRuntime service

2017-02-14 Thread BJ Hargrave
Well we don't want to add another whiteboard model to track changes to the whiteboard model (e.g. Http whiteboard). Who will watch the watchers? :-D
 
Since it is somewhat of a special case to be able to track changes to the DTO set, we felt a service property holding the change count would be sufficient and it would work with the existing service event model. In DS, you can have a reference to ServiceComponentRuntime service and use the updated method for the reference to get called when the service properties change.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Scott Lewis <sle...@composent.com>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: Re: [osgi-dev] ServiceComponentRuntime serviceDate: Tue, Feb 14, 2017 2:45 PM 
On 2/13/2017 10:07 AM, BJ Hargrave wrote:
Not in R6. Under discussion for R7 is a service property for the ServiceComponentRuntime service which would hold a change count for the DTO set. Then whenever the DTO set changes, the service properties for the ServiceComponentRuntime service would change. So you could listen for MODIFIED service events on the ServiceComponentRuntime service if you need to track changes to the DTO set.
 
We also look to use the same service property for HttpServiceRuntime and JaxRSServiceRuntime for the same reason.Thanks for the info.   Although I don't have any objection to the service property...wouldn't there be some consumer advantages (common patterns) to also having *Listener + *Event added to the ServiceComponentRuntime package...e.g. RSA?Scott 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] ServiceComponentRuntime service

2017-02-13 Thread BJ Hargrave
Not in R6. Under discussion for R7 is a service property for the ServiceComponentRuntime service which would hold a change count for the DTO set. Then whenever the DTO set changes, the service properties for the ServiceComponentRuntime service would change. So you could listen for MODIFIED service events on the ServiceComponentRuntime service if you need to track changes to the DTO set.
 
We also look to use the same service property for HttpServiceRuntime and JaxRSServiceRuntime for the same reason.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Scott Lewis Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] ServiceComponentRuntime serviceDate: Sun, Feb 12, 2017 4:34 PM 
In R6 chap 112 there is theorg.osgi.service.component.runtime.ServiceComponentRuntime service thatexposes (e.g) getComponentDescriptionDTO,enableComponent/disableComponent, etc.  One thing that does not seem tobe present, however, is any sort of listener/event structure forresponding to component changes.An example of what I mean by such a listener/event structure exists inthe RemoteServiceAdminListener and RemoteServiceAdminEvent (and withEventAdmin for async).Is there some other pattern for (e.g.) SCR tooling to respond to suchruntime changes?Thanks,Scott___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Enroute

2016-12-06 Thread BJ Hargrave
Perhaps you should go through the tutorials then.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: "Leschke, Scott" Sent by: osgi-dev-boun...@mail.osgi.orgTo: "osgi-dev@mail.osgi.org" Cc:Subject: [osgi-dev] EnrouteDate: Tue, Dec 6, 2016 3:29 PM  
I’ve started looking at Enroute and I’m a bit confused as to how it is distinguished from some of the other profiles that exist, say Enterprise or Residential? There’s talk of tooling and naming conventions and the like but it would seem to me that bndtools is general purpose OSGi and it’s not clear from what I’ve looked at online how exactly the naming conventions (.api, .provider, etc.) are enforced and what exactly they buy you.
 
I have to admit I haven’t sat through a full tutorial yet because I was just kind of trying to get clarity on what exactly it is intended to buy you. I also expected to see an osgi.enroute repo in bndtools Repository view (under Bndtools Hub) but there is none so I’m not sure how to even get access to that profile.
 
Color me mildly confused.
 
Scott
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] JPM4J missing in new install as per enRoute Tutorrial

2016-12-06 Thread BJ Hargrave
I think that this list is not the forum to discuss jpm4j which is perhaps why it was suggested to take the discussion off list.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Elliot Huntington Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: Re: [osgi-dev] JPM4J missing in new install as per enRoute TutorrialDate: Tue, Dec 6, 2016 2:13 PM 
I think the details would be better discussed in a public thread rather than a private one, imho.
 
On Dec 6, 2016 4:47 AM, "Daghan ACAY"  wrote:

Hi Paul,
There are some changes for using maven based repositories vs jpm4j based repositories. For example in 3.3  bndtools plugin started using mvn like xml files instead of jpm4j like .json files.
Please send me a private message and i am happy to discuss the details.
CheersDaghan
Sent by MailWise – See your emails as clean, short chats.
 Original Message From: Paul F Fraser Sent: Tuesday, December 6, 2016 09:13 PMTo: OSGi Developer Mail List Subject: [osgi-dev] JPM4J missing in new install as per enRoute Tutorrial 
From a new install of eclipse (neon) and bndtools 3.3 and following the enRoute starting tutorialfor a separate workspace and git dir.The option to find bundles with  jpm4j is not available.For example before I had this problem, if I typed gson in the repository search box I was offeredthe opportunity to find it in jpm4j.Anyone else had this problem?RegardsPaul Fraser___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Strange issue with enRoute and Aries SPI Fly.

2016-12-05 Thread BJ Hargrave
I am not aware of any support in -runbundles to set start levels for bundle. But the bnd launcher should start the bundle in the order they are specified on the -runbundles instruction. Did you try putting those bundles first that need to be started first?
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Elliot Huntington Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Strange issue with enRoute and Aries SPI Fly.Date: Mon, Dec 5, 2016 1:35 PM 
The motivation for this thread is that I am experimenting with an OSGi enRoute project that uses the Apache Aries SPI-Fly dynamic weaving libraries to play an MP3 file. The example project is on github at: https://github.com/axiopisty/com.github.axiopisty.plarpebu. This project has 5 enRoute modules:

JavaFX APIJavaFX API ProviderMedia Player APIMedia Player API ProviderApplication
What I have noticed is that when I use 'osgi.enroute.debug.api' I can use the debug commands in the gogo shell to successfully load, play, pause, and stop the media player. The application will successfully play an MP3 file. However, when using the GUI to 'load' the MP3 file an exception occurs that indicates something is not working right with the SPI Fly dynamic weaving integration. I have not been able to figure out why the 'load' operation works successfully when using the gogo shell, but does not work when called from the GUI. I'm wondering if it might have something to do with the bundle start levels because according to the SPI Fly documentation, "any OSGi Bundle that uses the OSGi 4.3 WeavingHooks, the weaver bundle (org.apache.aries.spifly.dynamic.bundle) needs to be active before any bundles that need to be dynamically woven. OSGi start levels can provide a mechanism to control this."
My suspicion is that because the JavaFX provider is a DS component with scope SINGLETON and immediate = true, that this bundle is activated before the dynamic weaving bundle in the runtime, which is probably causing the problem described.
So my question is, when using bnd, is there some directive or syntax that can be used with the -runbundles directive that indicates the bundle start level? I would greatly appreciate your help figuring out why the media player service I created in this example works successfully from the gogo shell, but not from the gui, all within the same runtime application.

 
Sincerely,
Elliot
 
 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] component factory and configuration

2016-11-22 Thread BJ Hargrave
SCR will create one component instance per factory configuration. You don't need to do anything special other than use the factory pid as the component pid and create factory configurations in Config Admin.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Scott Lewis <sle...@composent.com>Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: Re: [osgi-dev] component factory and configurationDate: Tue, Nov 22, 2016 12:35 AM 
On 11/21/2016 8:11 AM, BJ Hargrave wrote:
 

If you want to create a specific number of services each configured by a factory configuration instance, then prototype scopes services are orthogonal to your needs.If not prototype scope services...for service instances configured by factory configuration instances..then what?Scott 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] OSGi factory pids and configuration admin

2016-11-21 Thread BJ Hargrave
I think you need to ask this in a felix list since you are asking about how felix fileinstall works.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Benson Margulies Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] OSGi factory pids and configuration adminDate: Mon, Nov 21, 2016 1:34 PM 
Given a factory pid of a.b.c, and a pid of q, I am a littledisoriented about how to manage some properties.Felix fileinstall parses a.b.c-q as 'pid = a.b.c', factoryPid = 'q'.It calls createFactoryConfiguration for 'a.b.c', and ignores the q.The 'updated' method on the service is called on a pid like'a.b.c.UNIQUE-STRING'.Do I need to add something to the properties so that the pid remains 'a.b.c-q'?As it is, I'm failing to use a second call to configuration admin toupdate one of the properties.___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] component factory and configuration

2016-11-21 Thread BJ Hargrave
There is a life cycle mismatch here. For a prototype scope service, a new instance is created for each consumer of the service. So there are potentially an infinite number of service instances.
 
For factory configurations, there are a finite number of configuration instances because someone has to set them and they are set in advance of the prototype service instance creation.
 
So there is no way to match a prototype scope service instance with any specific factory configuration instance.
 
Prototype scope services are for the use case of managing resources on behalf of the service consumer such that for each instance, some resources are allocated which must be deallocated when then service instance is released. The notion of prototype scoped services was created in support  of EJB and CDI beans (see RFC 195 for some background).
 
If you want to create a specific number of services each configured by a factory configuration instance, then prototype scopes services are orthogonal to your needs.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Scott Lewis Sent by: osgi-dev-boun...@mail.osgi.orgTo: osgi-dev@mail.osgi.orgCc:Subject: Re: [osgi-dev] component factory and configurationDate: Mon, Nov 21, 2016 10:33 AM 
On 11/21/2016 12:50 AM, Timothy Ward wrote:
Any thoughts/comments about method for getting a distinct configuration associated with every service instance? 
This is fine for my use case WRT creating service instances on demand via the FooConsumer.   However, I would like to be able to have a distinct/new configuration associated with each new FooImpl, rather than a single FooConfig instance assigned to all of them.   Is this possible using the PROTOTYPE pattern, or is it necessary to use the ComponentFactory in the manner Tim describes to accomplish this:The way that this is done is to pass the configuration using the newInstance method. Effectively your pattern would be to register a ConfigurationListener or ManagedServiceFactory, passing the configuration Dictionary to the Component Factory for each Factory Configuration. 

___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] prototype scope and configuration

2016-11-18 Thread BJ Hargrave
No. All component instances for the prototype scope service share the same component properties. But each instance represents a different service consumer. This is much the same as a bundle scope service where each component instance has the same component properties but represents a different consumer bundle.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Scott Lewis Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] prototype scope and configurationDate: Fri, Nov 18, 2016 1:41 PM 
While reading Neil's description of DS support for prototype scope in[1],  I had the following question:   Is it possible to associate aconfiguration with a specific prototype-scoped serviceinstance...declaratively or programmatically?  If so, how?Scott[1] http://njbartlett.name/2015/08/17/osgir6-declarative-services.html___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Basic feedback on JAX-RS whiteboard spec

2016-11-10 Thread BJ Hargrave
As stated in the front matter of the RFC, you should provide feedback to the OSGi public bugzilla system at https://osgi.org/bugzilla/.
 
Thanks,
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Sergey Beryozkin Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Basic feedback on JAX-RS whiteboard specDate: Thu, Nov 10, 2016 12:29 PM 
Hi,Sorry if it is not the right place to provide the feedback, I justwanted to share some basic feedback.- The text is written well and is easy to understand- May be worth distinguishing between PreMatch and PostMatch filters -the former are run before a resource method has been found- JAX-RS 2.1 draft introduces a client support for CompletableFuture orother alternatives (such as RxJava) via an rx() as opposed to async()bridge, with an RxInvoker wrapping a specific Rx library/code.- The use of List in the examples - the minor issue is that itis generally difficult to write an interoperable code in such cases forXML formats - every JAX-RS 2.0 impl or List handler may have its ownidea on what the root name is.That is itCheers, Sergey___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Why is 'start' an error for fragments?

2016-11-10 Thread BJ Hargrave
Not really. Fragments are not bundle in that they do not have a class loader or a separate activation life. They can be attached to zero or more host bundles (non-fragment bundles). So to start them is not possible. To make it a no-op will break an invariant: After callings start, the bundle must be STARTING/ACTIVE or an exception is thrown to indicate failure to start. Since a fragment can not be started, that means an exception must be thrown.
 
Generally, unless you are writing a management agent, you probably should not be starting/stopping bundles. If you are writing a management agent, then the distinction between fragments and bundles is important to to manage.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Benson Margulies Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Why is 'start' an error for fragments?Date: Thu, Nov 10, 2016 10:59 AM 
Has there ever been consideration of making 'start' be a harmlessno-op for fragment bundles? I keep having to write code to check theheaders and avoid the call to start on fragments.___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Getting _all_ of the framework properties

2016-11-04 Thread BJ Hargrave
There is not such a method.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Benson Margulies Sent by: osgi-dev-boun...@mail.osgi.orgTo: OSGi Developer Mail List Cc:Subject: [osgi-dev] Getting _all_ of the framework propertiesDate: Fri, Nov 4, 2016 8:03 AM 
Is there a service that has access to the enumeration of all theframework property keys? BundleContext.getProperty can only get theones I know about, of course.___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev 
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Query

2016-11-03 Thread BJ Hargrave
There is nothing specific to OSGi about execing external applications. That is just normal java.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Sent by: osgi-dev-boun...@mail.osgi.orgTo: Cc:Subject: [osgi-dev] QueryDate: Thu, Nov 3, 2016 5:42 AM  
Hi all,
 
Can I invoke an external CPP/Linux application (lying in the same machine) from with a provider service in Enroute? If so, how? 
I tried the regular Runtime.getRuntime().exec() and also the ProcessBuilder but failed to invoke the app. 
 
Thanks,
ManojThe information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Plain Jar to OSGi Bundle conversion

2016-10-21 Thread BJ Hargrave
That is just a downloading issue. Not an issue OSGi-related issue.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Sent by: osgi-dev-boun...@mail.osgi.orgTo: Cc:Subject: [osgi-dev] Plain Jar to OSGi Bundle conversionDate: Fri, Oct 21, 2016 2:51 AM 
Hi All,
 
I was trying the  https://github.com/stempler/bnd-platform-minimal  for Plain Jar to OSGi Bundle conversion.  I am on Ubuntu/Java 8/Gradle 3.1
As I run ./gradlew in a Linux terminal, it goes on to fetch and gradle and aborts. Please help. PFA of my modified build.gradle
 
 
manoj@manoj-Latitude-E5420:~/IoT Framework/Utilities/bnd-platform-minimal-master$ ./gradlewDownloading https://services.gradle.org/distributions/gradle-2.10-bin.zipException in thread "main" java.net.ConnectException: Connection timed out    at java.net.PlainSocketImpl.socketConnect(Native Method)    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)    at java.net.Socket.connect(Socket.java:589)    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)    at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)    at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264)    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)    at org.gradle.wrapper.Download.downloadInternal(Download.java:56)    at org.gradle.wrapper.Download.download(Download.java:42)    at org.gradle.wrapper.Install$1.call(Install.java:57)    at org.gradle.wrapper.Install$1.call(Install.java:44)    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)    at org.gradle.wrapper.Install.createDist(Install.java:44)    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)manoj@manoj-Latitude-E5420:~/IoT Framework/Utilities/bnd-platform-minimal-master$ 

 
Thanks,
ManojThe information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

 
___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Help

2016-10-20 Thread BJ Hargrave
You need to put the native lib in the bundle and put a Bundle-NativeCode header in the bundle's manifest with the necessary information. See the OSGi Core spec for details.
 
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr...@us.ibm.com
 
 
- Original message -From: Sent by: osgi-dev-boun...@mail.osgi.orgTo: Cc:Subject: [osgi-dev] HelpDate: Thu, Oct 20, 2016 6:24 AM  
Hi all,
 
I am on Enroute/Bndtools… 
 
I have a java native library (xxx_java.so) which I am plan to load using code as below in my .java file.
 
static {
    System.loadlibrary(xxx_java);
}
 
Now, where, which directory and how do I place/put my xxx_java.so file?
 
Thanks,
Manoj
 The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

___OSGi Developer Mail Listosgi-dev@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

  1   2   3   4   >