Re: [osgi-dev] Compendium services

2020-08-16 Thread Tim Ward via osgi-dev
Yes, it’s a requirement of the OSGi specification process that there be a reference implementation and test suite for every specification chapter. Note that the reference implementation may not always be open source (although it is very rare that it isn’t) and isn’t guaranteed to be

Re: [osgi-dev] How to: File Upload with JAX-RS Whiteboard

2020-07-08 Thread Tim Ward via osgi-dev
I’m glad that I was able to help and blog posts are always welcome! All the best, Tim > On 7 Jul 2020, at 13:10, Fauth Dirk (CAP-SST/ESM1) via osgi-dev > wrote: > > Hi Tim, > > Thanks a lot! I would have never come to that solution by myself! Once > everything is setup I will write a blog

Re: [osgi-dev] Regarding Transaction Control

2020-04-07 Thread Tim Ward via osgi-dev
Hi Scott, If you’re using JDBC you don’t really care about JPA. Therefore you should compile against the OSGi jar, but not worry about deploying it at runtime. Instead you can just deploy the Aries Transaction Control implementation (which includes a substitutable export of the Transaction

Re: [osgi-dev] Intermittent failure to getService

2020-03-02 Thread Tim Ward via osgi-dev
Hi Alain, Is it possible that someone has a reference to a BaValidationManagerExt service instance that they aren’t releasing after ungetting it (or that they’re holding onto after it has been unregistered)? It might be an SCR bug, but it’s more likely to be some code holding onto a component

Re: [osgi-dev] [FDC-External]: Re: DB2 Enroute OSGi Connectivity

2020-01-14 Thread Tim Ward via osgi-dev
late... I will look into the PAX-JDBC. Does > wrapping the DB2 Jar is still supported? > > From: osgi-dev-boun...@mail.osgi.org On > Behalf Of Tim Ward via osgi-dev > Sent: Monday, January 6, 2020 4:04 AM > To: Matthews, Kevin ; OSGi Developer Mail List > > Subject: [

Re: [osgi-dev] DB2 Enroute OSGi Connectivity

2020-01-06 Thread Tim Ward via osgi-dev
Hi Kevin, Unfortunately you are correct that DB2 doesn’t provide an OSGi-enabled version of its driver, however it is possible to make it work (with a little effort). Implementing the JDBC Service specification yourself is pretty trivial (all you need to do is to register a single service

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

2019-10-24 Thread Tim Ward via osgi-dev
Hi Scott, As the author of the Transaction Control specification I can attempt to explain to you the reasoning for the example that is confusing you. In the Transaction Control specification there are three primary sets of actors: People implementing the core TransactionControl service (i.e.

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

2019-10-08 Thread Tim Ward via osgi-dev
> My question is, how can I tell to the Configurator bundle to not process > resources that contains placeholder until my ConfigurationPlugin is up? There are ways that you could attempt to do this, however they’re all inelegant and error prone. What would make more sense would be for the

Re: [osgi-dev] Deactivating a component manually

2019-09-23 Thread Tim Ward via osgi-dev
Hi Alain, This sounds exactly like the problem that Open Security Controller had when using Vaadin. They wanted their various UI types to be DS components so that they could use various services to talk to the rest of the system. Obviously the UI types need to be prototype scope because each

Re: [osgi-dev] Enroute Tutorial - generating indexes

2019-08-22 Thread Tim Ward via osgi-dev
Hi Kevin, Have you installed Bndtools? If not then it is highly recommended to make your development more productive. You can see how it is used in https://enroute.osgi.org/tutorial/020-tutorial_qs.html#resolving-the-application

Re: [osgi-dev] Migrating a service provider interface to OSGi that's similar to SPI

2019-08-22 Thread Tim Ward via osgi-dev
Hello, When you say that each client needs a different service instance, would a bundle need more than one instance (i.e. would a ServiceFactory be sufficient or does it need to be a PrototypeServiceFactory)? Also, where are the Strings in the String array coming from? If those are passed in

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

2019-07-25 Thread Tim Ward via osgi-dev
Interestingly this is the opposite conclusion that most people come to. Until recently Bndtools did not support Maven at all and was 100% Gradle. There has been a lot of work to bring Maven support up to the same level as Gradle by the team, but I don’t think that many of us would say that

Re: [osgi-dev] OSGi book recommendations

2019-07-25 Thread Tim Ward via osgi-dev
As far as English Language books go, I’m not aware of anything that fits the bill. Enterprise OSGi in Action is probably the most “up to date” of the books, but it uses Blueprint. OSGi in Depth mostly focuses on the low-level APIs (which I would definitely not recommend using), OSGi in Action

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

2019-06-20 Thread Tim Ward via osgi-dev
Right, so lets look at these one by one: > "The importer's version range matches the exporter's version. See Semantic > Versioning > .” > The reference to semantic versioning makes the

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

2019-06-18 Thread Tim Ward via osgi-dev
Michael, I promise that we are trying to help, but there’s clearly quite a bit of confusion here. I’ll try to take the questions individually, and we can attempt to separate your questions about build/packaging (i.e. creating your bundle) and resolving (i.e. creating your deployment). These

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

2019-06-18 Thread Tim Ward via osgi-dev
>> Considering this, lowering a lower bound of an Import-Package statement when >> resolving should be acknowledged as a bug. >> Bnd does not alter the version used when resolving, as this would give “incorrect” answers that don’t resolve. The resolver must use the exact metadata from the

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

2019-06-17 Thread Tim Ward via osgi-dev
Hi > I may have expressed myself badly. Nothing goes wrong, everything works > according to the specification, which states that the micro part of the > version should be ignored when resolving bundles. …. > If OSGI didn't specify that the micro part should be dropped, then > everything would

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

2019-06-17 Thread Tim Ward via osgi-dev
Hi Michael, I’m afraid that there’s quite a lot of missing information before I could come to a conclusion about what’s going on. What are your input requirements? Have you checked that B actually has the version range that you think it does? Are there two versions of A being deployed? If it’s

Re: [osgi-dev] Multiple bind attempts to 8080

2019-03-25 Thread Tim Ward via osgi-dev
There are definitely two different versions of Jetty trying to start up in your runtime: This one: > 03/23/2019 09:41:58.645|INFO |main|Started > ServerConnector@77a074b4{HTTP/1.1,[http/1.1]}{0.0.0.0:8080 > } > > [INFO] Started Jetty 9.4.9.v20180320 at port(s) HTTP:8080

Re: [osgi-dev] Removing queued events in Push Steams

2019-03-16 Thread Tim Ward via osgi-dev
Hi - I’m afraid that I’m out on vacation this week, so I can’t put quite as much into my reply as I normally would. It sounds like you have a PushStream pipeline with multiple buffered stages. This isn’t a problem, and can be a good thing, but as you’re noticing it is leading to the following

Re: [osgi-dev] objectClass=org.osgi.service.component.ComponentFactory missing

2019-03-08 Thread Tim Ward via osgi-dev
This looks like a missing feature in bnd. When bnd spots that you have created a factory component in your bundle then it should mark the service as registered. As a workaround you should be able to add a Capability annotation to the component in question marking that a ComponentFactory

Re: [osgi-dev] Checking index project APP for rebuild

2019-03-06 Thread Tim Ward via osgi-dev
> On 6 Mar 2019, at 10:56, Paul F Fraser wrote: > > Hi Tim, > > On 6/03/2019 8:41 pm, Tim Ward wrote: >> Hi Paul, >> >> Firstly - this sounds like something for the Bndtools list rather than the >> OSGi developer list, in that your asking a question about the Bndtools M2E >> integration,

Re: [osgi-dev] Checking index project APP for rebuild

2019-03-06 Thread Tim Ward via osgi-dev
Hi Paul, Firstly - this sounds like something for the Bndtools list rather than the OSGi developer list, in that your asking a question about the Bndtools M2E integration, rather than a question about OSGi enRoute. That said, “a long time” isn’t hugely clear - are we talking seconds or

Re: [osgi-dev] Removing queued events in Push Steams

2019-02-27 Thread Tim Ward via osgi-dev
Another option would be for you to take control of the queuing using a QueuePolicy. That would enable you to insert work at the head of the buffer (or at least higher up) if it was more important. You could also remove some of the entries if they are invalidated by the higher priority insert.

Re: [osgi-dev] SCR API

2019-02-22 Thread Tim Ward via osgi-dev
Hi Thomas, I’m not sure that there is a naming issue here, but possibly a different misunderstanding. > From my understanding there are two kinds of "services”: This is not really accurate. There is only one kind of service in OSGi, and it’s an object which has been registered with the

Re: [osgi-dev] ComponentServiceObjects vs ServiceObjects

2019-02-19 Thread Tim Ward via osgi-dev
> As I get it ComponentServiceObjects are just for use within Components and > are obtained vie @Reference? Yes - you should *always* use ComponentServiceObjects if you want to get on-demand instances of a prototype scope service inside your DS component. > But why are not ServiceObjects used

Re: [osgi-dev] Clarification on reference behavior regarding field injection

2019-02-18 Thread Tim Ward via osgi-dev
Hi, The build works fine for me in GitPod. You probably have corrupt things in your local repo, either delete them or force an update of snapshots (-U on the command line). Note that you also get a nice error message for the case that you claim didn’t work: [ERROR] Failed to execute goal

Re: [osgi-dev] Clarification on reference behavior regarding field injection

2019-02-18 Thread Tim Ward via osgi-dev
> When I change the version number of bnd to 4.2.0 in the standard enRoute > setup, then some of the bnd-plugins can not be found by maven. That’s because and 4.2.0 isn’t released yet - you need to add a plugin repository containing 4.2.0-SNAPSHOT (which is also the version you should be

Re: [osgi-dev] Clarification on reference behavior regarding field injection

2019-02-18 Thread Tim Ward via osgi-dev
Hi Thomas, Just to clarify, the behaviour that you see with static reluctant services will always look “odd” for cardinalities other than mandatory, and what you’ve recorded is 100% correct behaviour. Static references force the component to be re-created if the value of the reference changes

Re: [osgi-dev] Aliasing OSGi DS annotations

2019-02-14 Thread Tim Ward via osgi-dev
Hi, There isn’t any sort of Aliasing for DS annotations. Best Regards, Tim > On 14 Feb 2019, at 09:10, Thomas Driessen via osgi-dev > wrote: > > Hi, > > is there a mechanism in OSGi that allows to alias specific (DS) annotations? > (Seems to be possible in Spring according to Vaadin) >

Re: [osgi-dev] Push Streams Event grouping and batching

2019-02-06 Thread Tim Ward via osgi-dev
So having dug further, the following is sufficient: Promise>> result = psp.buildStream(sps) .withExecutor(Executors.newFixedThreadPool(2)) .build() .asyncMap(2, 0, new StreamDebouncer(

Re: [osgi-dev] Push Streams Event grouping and batching

2019-02-06 Thread Tim Ward via osgi-dev
Hi Alain, Having applied some step by step debugging the issue I can see is actually a deadlock in the async worker pool - we call asyncMap with a parallelism of 2, but we use the default executor from the push stream, which has only one thread. If the timing is wrong then we end up with the

Re: [osgi-dev] Remote service (thread) context properties?

2019-02-06 Thread Tim Ward via osgi-dev
Hi Bernd, What you’re asking for isn’t a required part of the RSA standard, which means that providers don’t have to offer it. There is, however, room for it to exist within the standard. OSGi Remote Services (and Remote Service Admin) define the concept of “intents” which are additional

Re: [osgi-dev] enRoute Project archetype not working correctly?

2019-02-05 Thread Tim Ward via osgi-dev
Hi Thomas, What was the command that you used to generate the folders? The Maven Archetype Plugin is useful, but the default version used by Maven is pretty old. The OSGi enRoute recommendation is that you use version 3.0.1 of the archetype plugin, as described in

Re: [osgi-dev] Move from bnd workspace to maven (enroute) workspace

2019-01-31 Thread Tim Ward via osgi-dev
Hi Thomas, The simple answer to your question is yes, however the more involved answer is that you probably shouldn’t. If you want to read up on ways to handle Maven dependency management then I can suggest looking at:

Re: [osgi-dev] Move from bnd workspace to maven (enroute) workspace

2019-01-31 Thread Tim Ward via osgi-dev
Hi > On 31 Jan 2019, at 15:22, Thomas Driessen via osgi-dev > wrote: > > Hi, > > I'm currently trying to get used to the new enroute maven workspace layout > and now have some questions :) > > 1) > In a bnd workspace I had the central.xml file where I put all the > dependencies I wanted in

Re: [osgi-dev] ContainerRequestFilter/ContainerResponseFilter life cycle

2019-01-30 Thread Tim Ward via osgi-dev
> On 30 Jan 2019, at 16:52, Nhut Thai Le wrote: > > Tim, > > Thank you for quickly identify my problems :D, please see my comments inline > > On Wed, Jan 30, 2019 at 10:13 AM Tim Ward > wrote: > Hi, > > Firstly: > > Why does DiagramRestApp do this? > >>

Re: [osgi-dev] Limks to R7 ionline spec

2019-01-30 Thread Tim Ward via osgi-dev
When I type "osgi specifications” into Google the first links I get are: To the main specifications page you’re already at (this requires you to follow the download link for the version you want) To the HTML version of the R7 core specification To the HTML version of the R7 compendium

Re: [osgi-dev] Prototype scope components and Fluent builder

2019-01-30 Thread Tim Ward via osgi-dev
I’m not quite sure what this question means, but the most obvious interpretation is “how should I deal with registering a service that is a fluent builder?”. The JAX-RS Whiteboard does this with the ClientBuilder service

Re: [osgi-dev] Loading xxxApp contents has encountererd NPE

2019-01-30 Thread Tim Ward via osgi-dev
Hi Paul, It’s not normal to see NPEs during your build, but I also don’t see them when using OSGi enRoute. Assuming that you can identify the Maven plugin causing the problem it might be worth talking to the maintainers of the plugin. At the very least it’s hard to diagnose without more

Re: [osgi-dev] ContainerRequestFilter/ContainerResponseFilter life cycle

2019-01-29 Thread Tim Ward via osgi-dev
Hi, As described in the JAX-RS Whiteboard spec JAX-RS extension instances are required to be singletons (I’m talking about the objects, not the services) by the JAX-RS specification itself. Therefore within an

Re: [osgi-dev] Scanning classes at runtime

2019-01-23 Thread Tim Ward via osgi-dev
Depending on how much control you have over the bundles providing the types you could also look at providing your own extender capabiltiy/requirement model which would further restrict your search space, and potentially allow further optimisations. You should take a look at the OSGi CDI

Re: [osgi-dev] Scanning classes at runtime

2019-01-23 Thread Tim Ward via osgi-dev
Hi, You can optimise this pretty heavily by using the bundle wirings to look for bundles which are wired to the same API packages as you (the one(s) that contain the relevant interface/supertype/annotation). This way you can avoid scanning bundles which can’t possibly contain relevant types.

Re: [osgi-dev] OSGi Http Client Missing Requirement

2019-01-21 Thread Tim Ward via osgi-dev
Hi Paul, This is a different problem, in that where the previous requirement for the “osgi.service” namespace was an “active” time requirement (and therefore not enforced at runtime), this is a resolve time requirement that *will* prevent your bundles from resolving/starting in the framework.

Re: [osgi-dev] Vaadin flow works in bnd workspace, fails in enRoute project

2019-01-16 Thread Tim Ward via osgi-dev
Hi Paul, The error you’re seeing is a resolution failure because the "com.vaadin.flow.osgi version=1.2.3” bundle has a requirement in the “osgi.service” namespace for the service with interface “org.osgi.service.http.HttpService”. This basically says that the Vaadin flow bundle is trying to

Re: [osgi-dev] Push Streams Event grouping and batching

2019-01-07 Thread Tim Ward via osgi-dev
I wrote the whole of this myself this morning - I tend to do examples as unit tests because they’re easy for people to try out and run. I’m not aware of a substantial PushStream teat bucket other than the OSGi Compliance Test Suite, which is available to members. If you want to start an open

Re: [osgi-dev] Push Streams Event grouping and batching

2019-01-07 Thread Tim Ward via osgi-dev
This use case is effectively a “debouncing” behaviour, which is possible to implement with a little thought. There are a couple of ways to attempt it. This one uses the asyncMap operation to asynchronously gather the events until it either times out the promise or it hits the maximum stream

Re: [osgi-dev] PushStream Question

2018-12-10 Thread Tim Ward via osgi-dev
Hi Clément, You should raise a bug about the JavaDoc/implementation inconsistency in the OSGi bugzilla. The StackOverflow question is now answered, hopefully to your satisfaction. Best Regards, Tim > On 9 Dec 2018, at 21:35, Clément Delgrange via osgi-dev > wrote: > > Hi all, > > I have

Re: [osgi-dev] OSGi connecting to SqlServer with Apache Aries

2018-12-09 Thread Tim Ward via osgi-dev
It sounds like you have done the right things, but my guess is that you don’t have a JDBC service implementation for SQLServer. H2 and Postgres have done the work to implement the OSGi standard (it’s pretty small), but quite a few other providers haven’t. You could either roll your own

Re: [osgi-dev] enRoute JPA example questions

2018-12-07 Thread Tim Ward via osgi-dev
Hi Clément, > The de-coupling is not the fact that they are DTOs? If the API had defined > Interfaces or Classes the de-coupling would be the same. In this case the decoupling is from the data model. If the DTO types were JPA entities (i.e. they had JPA annotations on them) then everyone would

Re: [osgi-dev] Problem starting Aries JAX-RS Whiteboard

2018-12-03 Thread Tim Ward via osgi-dev
Hi Alain, Sorry this took you so long to work out - Sunday isn’t the best time to get a response I’m afraid! In summary - this should have “just worked” for you. I’m sorry that it didn’t, but unfortunately in this case the web container implementation that you are using has some packaging

Re: [osgi-dev] Correct way to handle error/recovery in PushStream

2018-11-29 Thread Tim Ward via osgi-dev
That looks reasonable to me. You could also do it using an error handler on the promise returned by forEach(), but what you’re doing is also fine. Depending on your threading model you may lose some events, specifically if there’s a buffer in the SimplePushEventSource that you are using (which

Re: [osgi-dev] No service events for an embedded OSGi Framework?

2018-11-28 Thread Tim Ward via osgi-dev
My guess is that you are trying to start a framework from inside a framework, and then the code outside is using a different view of the ComponentFactory interface from the code inside. Normally you would need to use a system packages extra property when launching the inner framework (to share

Re: [osgi-dev] Disposing component instances

2018-11-25 Thread Tim Ward via osgi-dev
es are better because they: >>>>>>>>>> >>>>>>>>>> Don’t require the service implementation to use DS (they may wish to >>>>>>>>>> use something else) >>>>>>>>>> Will have satisfied

Re: [osgi-dev] Disposing component instances

2018-11-25 Thread Tim Ward via osgi-dev
ce() call should be all you >>> need each time you need a new instance, followed by a call to >>> ungetService() later when you’re done with it. >>> >>> Tim >>> >>>> On 22 Aug 2018, at 12:06, Alain Picard >>> <mailto:pic...

Re: [osgi-dev] Circular references with Factory component

2018-11-23 Thread Tim Ward via osgi-dev
The critical part of the spec is available at https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-factorycomponent - the key words are "SCR must

Re: [osgi-dev] osgi and timer task

2018-11-19 Thread Tim Ward via osgi-dev
If you are asking “I observe this behaviour, is it correct?” then this sounds like a well written bundle with good behaviour. Threads started by a bundle when it starts should be stopped when it stops. Similarly sockets opened, or other resources claimed, should be closed/released. If you

Re: [osgi-dev] Push Stream reset/flush howto

2018-11-15 Thread Tim Ward via osgi-dev
> So are you proposing something like process an event and decide that you will > have to re-query, fails the promise with a “CacheInvalidatedException” and > then in the recovery function perform the re-query and then just keep > processing events on the stream? Technically it would be a new

Re: [osgi-dev] Push Stream reset/flush howto

2018-11-15 Thread Tim Ward via osgi-dev
> My expectation is that after the "flush error event", I can again accept new > published event and process those until I get another case where the cached > information is invalidated (i.e. the notification event changes the result > set and there is no way to simply update the cache and we

Re: [osgi-dev] Push Stream reset/flush howto

2018-11-15 Thread Tim Ward via osgi-dev
The correct option will depend on what you want to happen. If you use an endOfStream() or close() operation then you are telling your push stream that the data has reached a “natural end”. This will cause the promise at the end of your stream to resolve normally. This may be the right thing in

Re: [osgi-dev] Circular reference with Prototype components

2018-11-14 Thread Tim Ward via osgi-dev
Hi Alain, I note that you don’t include the setter code, nor the activation code, but at a guess in one of these two places you are calling getService on the ComponentServiceObjects. This will in turn cause the ZKRenderer service instance to be created. If this instance also has an injected

Re: [osgi-dev] Get Bundle for package and version

2018-11-12 Thread Tim Ward via osgi-dev
This all sounds horrible - why do you have a whiteboard that is making reflective calls on remote service objects? If you *really* want to make this work then your best option would be to have the whiteboard implementation listen for remote service discovery events and to create a local bundle

Re: [osgi-dev] Is it possible to use an interface type as the config argument of an activate method ?

2018-11-07 Thread Tim Ward via osgi-dev
The @AttributeDefinition is a build time annotation, not a runtime annotation. There is therefore no visibility of the annotation values for DS to use at runtime. This also avoids your bundle from being coupled to the meta type API just because it uses the annotations. Best Regards, Tim > On

Re: [osgi-dev] Converting CompletableFuture to Promise

2018-10-29 Thread Tim Ward via osgi-dev
Hi Alain, Unsurprisingly this isn’t very hard to do: private PromiseFactory pf; public Promise toPromise(CompletionStage cs) { Deferred deferred = pf.deferred(); cs.whenComplete((r,e) -> { if(e == null) { deferred.resolve(r);

Re: [osgi-dev] Pushstream Example not compileable

2018-10-26 Thread Tim Ward via osgi-dev
You might find this easier to follow: public PromiseprintEvens() { PushStreamProvider psp = new PushStreamProvider(); SimplePushEventSource ses = psp.createSimpleEventSource(Long.class); // Begin delivery when someone is listening

Re: [osgi-dev] Servlet Context in OSGi

2018-10-10 Thread Tim Ward via osgi-dev
It’s also how the Aries JAX-RS whiteboard guarantees separation between the various whiteboard applications. Specifically one JAX-RS application shouldn’t impact another (for example via session state being visible). Tim > On 10 Oct 2018, at 14:34, Raymond Auge via osgi-dev > wrote: > > On

Re: [osgi-dev] Servlet Context in OSGi

2018-10-10 Thread Tim Ward via osgi-dev
It also provides a way to have separate user sessions (useful), different security configurations (useful), management of static resource mappings (useful), isolation of redirection to named servlets (less useful) and I’m sure a bunch of other things. Tim Sent from my iPhone > On 9 Oct 2018,

[osgi-dev] OSGi enRoute updates

2018-10-09 Thread Tim Ward via osgi-dev
Hi all, Just a quick note to let you know that there have been some minor updates to the OSGi enRoute archetypes and indexes. The archetypes now let you select the target Java version for resolving/running your application. This makes life easier when using Java 9/10/11. The RI index has been

Re: [osgi-dev] Need advice on design pattern using Promises

2018-10-05 Thread Tim Ward via osgi-dev
I will start by saying that the original is a fundamentally bad API design. It exposes side effects of the method (namely modifying the passed in Set) which should not ever be part of a sensible API contract. This method could return a Set (or a Promise>) indicating what it did, but actually

Re: [osgi-dev] configurationPid vs factory identifier

2018-09-28 Thread Tim Ward via osgi-dev
These are absolutely not the same things! You always want this one. In ten years I have used this hundreds of times, I have never used the other setup. > @Component( > configurationPid = “com.my.component”) > @Designate( > factory = true, > ocd = MyConfig.class) > public

Re: [osgi-dev] Integrating promises

2018-09-19 Thread Tim Ward via osgi-dev
It looks like it should be pretty simple… Promise myPromise = getPromise(); myPromise.onSuccess(listener::onResponse) .onFailure(listener::onFailure); Best Regards, Tim > On 19 Sep 2018, at 15:16, Alain Picard via osgi-dev > wrote: > > We are using ElasticSearch which provide an

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-09-03 Thread Tim Ward via osgi-dev
> On 3 Sep 2018, at 12:46, Alain Picard wrote: > > Tim, > > Regarding point 1, I feel like I dropped the ball and it makes sense. Not really, there genuinely is a bug in bnd 4.0, and it was only fixed in the 4.1 development stream recently (within the last week). > > Regarding point 2, I

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-09-03 Thread Tim Ward via osgi-dev
Problem 1: The Relevant bitts of the specification are: How component properties override each other at runtime: https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-component.properties

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-24 Thread Tim Ward via osgi-dev
Right, so in this case it looks like you’re running a whiteboard, is it possible you would be better off not using the service properties for this filtering? For example: @Reference(policy=DYNAMIC, cardinality=MULTIPLE) private final List renderers = new CopyOnWriteArrayList<>(); public

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-24 Thread Tim Ward via osgi-dev
Do these properties “represent” classes or are they actually classes? If they are just representations (which would be a good thing) then you can define a static string constant representing the class which is mapped internally to the correct class name (which can then change over time).

Re: [osgi-dev] Disposing component instances

2018-08-23 Thread Tim Ward via osgi-dev
bit close to some of my use >>> cases. >>> >>> I have cases where I have a Factory component that delivers instances and >>> calls an init method to configure the component, or might sometimes return >>> an existing matching one that is already cached (li

Re: [osgi-dev] Retrieving service configuration implementation in reference method

2018-08-23 Thread Tim Ward via osgi-dev
The properties visible in the Map (or ServiceReference) are the service properties. There is some overlap with configuration (services that are configurable are encouraged to publish configuration properties as service properties) but they are separate, and can be different. The only way that

Re: [osgi-dev] Disposing component instances

2018-08-22 Thread Tim Ward via osgi-dev
connection >> instances). With ComponentFactory I can create a new instance, call init on >> the new instance and return the ComponentInstance. The caller can then call >> getInstance and call dispose when done. I struggle to find a correct/easy >> way to do this with CSO. Am

Re: [osgi-dev] Disposing component instances

2018-08-22 Thread Tim Ward via osgi-dev
using the best approach or not? > > Thanks > Alain > > > On Wed, Aug 22, 2018 at 3:46 AM Tim Ward via osgi-dev <mailto:osgi-dev@mail.osgi.org>> wrote: > > >> On 21 Aug 2018, at 20:53, Paul F Fraser via osgi-dev > <mailto:osgi-dev@mail.osgi.org>

Re: [osgi-dev] Disposing component instances

2018-08-22 Thread Tim Ward via osgi-dev
> On 21 Aug 2018, at 20:53, Paul F Fraser via osgi-dev > wrote: > > On 22/08/2018 5:40 AM, Paul F Fraser via osgi-dev wrote: >> On 21/08/2018 10:00 PM, Tim Ward via osgi-dev wrote: >>> Have you looked at what the OSC project does? It uses Vaadin, and uses the

Re: [osgi-dev] Disposing component instances

2018-08-21 Thread Tim Ward via osgi-dev
Have you looked at what the OSC project does? It uses Vaadin, and uses the ViewProvider interface to provide view instances. These automatically have a detach listener added on creation so that they get correctly disposed when their parent container is closed. See

Re: [osgi-dev] Docker configuration via environment variables

2018-08-21 Thread Tim Ward via osgi-dev
with at least some reason to couple to the environment. Best Regards, Tim > On 21 Aug 2018, at 09:21, Peter Kriens wrote: > >> On 21 Aug 2018, at 10:11, Tim Ward via osgi-dev > <mailto:osgi-dev@mail.osgi.org>> wrote: >> Just another vote in favour of the Configura

Re: [osgi-dev] Docker configuration via environment variables

2018-08-21 Thread Tim Ward via osgi-dev
Just another vote in favour of the ConfigurationPlugin model - you can use this to post-process configurations wherever they come from (meaning it isn’t tied to the Configurer or Configurator). A configuration plugin that does this sort of work is easy to write, and if using DS could be done

Re: [osgi-dev] Question about consistency and visibility

2018-08-14 Thread Tim Ward via osgi-dev
> DS guarantees that activate is called before the service is registered and > thus available to others. This is not quite correct (although it is correct for immediate components). The service is registered after it becomes satisfied (all of its mandatory service and configuration

Re: [osgi-dev] Eclipse Extension-points and EMF in OSGI

2018-08-09 Thread Tim Ward via osgi-dev
I would expect that Mark Hoffman or Jürgen Albert might have some useful pointers, I’m pretty sure that they’re heavy users of EMF. Best Regards, Tim > On 9 Aug 2018, at 09:20, Alain Picard via osgi-dev > wrote: > > Scott, > > I noticed the split of the o.e.core.runtime and am already

Re: [osgi-dev] Reference not injected to component

2018-08-07 Thread Tim Ward via osgi-dev
According to the documentation KeyCloak can be provided as a Servlet Filter, which would avoid the need for a web.xml/WAB. https://www.keycloak.org/docs/2.5/securing_apps/topics/oidc/java/servlet-filter-adapter.html#_servlet_filter_adapter Best Regards, Tim Sent from my iPhone > On 7 Aug

Re: [osgi-dev] Reference not injected to component

2018-08-07 Thread Tim Ward via osgi-dev
You are aware that Servlet Filters are also supported by the whiteboard? See https://osgi.org/specification/osgi.cmpn/7.0.0/service.http.whiteboard.html#d0e121055 Just to reiterate my warning, continuing to

Re: [osgi-dev] Reference not injected to component

2018-08-07 Thread Tim Ward via osgi-dev
Hi, I’m afraid that if you’re using a WAB file then you absolutely can’t use DS, and vice versa. The Web Application Bundle specification exists as a mechanism to allow people to move from a non-OSGi world into OSGi, and there are a number of restrictions as a result. The one that you’re

Re: [osgi-dev] Reference not injected to component

2018-08-06 Thread Tim Ward via osgi-dev
I don’t see any Http Service whiteboard properties on the Servlet component. How are you registering it with the Servlet container? Tim Sent from my iPhone > On 6 Aug 2018, at 16:22, Nhut Thai Le via osgi-dev > wrote: > > Hello, > > I have a servlet defined like this: > >

Re: [osgi-dev] Extending Services

2018-08-03 Thread Tim Ward via osgi-dev
I agree with Neil that, in general, you don’t want to reference a service of the same type that you advertise without something to prevent you wiring to yourself. Service properties are a good way to do this, but so is type safety. For example does it really make sense for the

Re: [osgi-dev] Life-cycle race condition

2018-08-02 Thread Tim Ward via osgi-dev
As Peter has said, once you go asynchronous and/or long running the possibility that things can go wrong increases rapidly. That isn’t to say that your solution will need to be as involved as some of the ones that Peter is suggesting. It honestly sounds as though you could avoid this problem

Re: [osgi-dev] Life-cycle race condition

2018-08-02 Thread Tim Ward via osgi-dev
Hi David, Are you able to share this code, because it sounds as though the thread signalling model you’re using is wrong? From what you’re saying it sounds like the problem is in this other component. Specifically, that it is performing long running work that isn’t paying attention to its

Re: [osgi-dev] Life-cycle race condition

2018-08-01 Thread Tim Ward via osgi-dev
Hi David, In addition to interrupting the worker thread (which is a good idea). There are a couple of useful things that you can do using the support from java.util.concurrent. For example, setting a closed state: @Component public class MyClass { private final AtomicBoolean closed = new

Re: [osgi-dev] Setting reference target in component

2018-07-31 Thread Tim Ward via osgi-dev
This sounds like a variation on this question asked a few weeks ago in the osgi-dev list. In summary, there are a couple of ways to achieve what you’re trying to do, and using configuration admin may or may not be the best

Re: [osgi-dev] OSGI enroute bndrun file

2018-07-27 Thread Tim Ward via osgi-dev
Hi Kevin, You should never need to add SLF4J as a requirement, but you will need to add a logging implementation as a requirement if you wish to configure and use a specific logging implementation (for example logback). This, however, would be an important detail of your application because it

Re: [osgi-dev] OSGI enroute bndrun file

2018-07-27 Thread Tim Ward via osgi-dev
Note that BJ is referencing one possible way to use the bnd-resolver-maven-plugin and bnd-export-maven-plugin. The enRoute projects set up their bndrun files to use standalone indexes generated by the bnd-indexer-maven-plugin. These indexes are generated using the dependencies from the pom

Re: [osgi-dev] Possible issue

2018-07-26 Thread Tim Ward via osgi-dev
Hi Julio, I’m not quite sure that I follow your problem. The quickstart tutorial uses the project template, and creates the following module structure: quickstart/ | |- app/ | | | |-pom.xml | |- impl/ | |

Re: [osgi-dev] Dealing with bouncing

2018-07-23 Thread Tim Ward via osgi-dev
An alternative way to look at this is simply that your DS component needs to be sufficiently thread-safe to deal with the consequences of its own internal threading model. In this case: > What would be a good (and simple) strategy to handle this type of > long-running configuration, where the

Re: [osgi-dev] Service binding order

2018-07-18 Thread Tim Ward via osgi-dev
Promises are great, and should be used much more often! Note that if you want to have more control of the threading then you can instantiate a PromiseFactory with the executor that should be used to run callbacks. In this case, for example, you may wish to use an Immediate executor (available

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

2018-07-17 Thread Tim Ward via osgi-dev
Hi Alain It’s not possible to model this accurately at build time because services may come and go at runtime, and their service properties may change with configuration. Added to this it is also possible to change the target filters on references which changes/restricts what they may bind to.

  1   2   >