Re: [osgi-dev] Create instance of factory configuration at runtime

2017-12-09 Thread Tim Ward via osgi-dev
Hi Scott, That does work, but Configuration Admin has an old feature called location binding. This feature prevents a configuration being delivered to bundles other than the bundle with the specified bundle location. The one-arg version of createFactoryConfiguration that you’re using defaults

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

2018-05-06 Thread Tim Ward via osgi-dev
The Aries JPA snapshots have probably been deleted as Aries JPA 2.7.0 was released last week. The OSGi R7 API is now also released, so the enRoute indexes and archetypes will need to be updated for that too. There are likely to be other Apache projects doing the same thing as part of the R7 RI

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

2018-05-08 Thread Tim Ward via osgi-dev
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

Re: [osgi-dev] How to mock annotation based configs with defaults

2018-04-27 Thread Tim Ward via osgi-dev
There are actually two converter implementations available now! The reference implementation converter from OSGi (org.osgi:org.osgi.util.converter:1.0.0) went final last week, and the Felix Converter was released yesterday. Tim Sent from my iPhone > On 27 Apr 2018, at 13:45, Christian

Re: [osgi-dev] How to mock annotation based configs with defaults

2018-04-27 Thread Tim Ward via osgi-dev
Have you tried using the OSGi converter? You can fill a map with properties and then just: Converters.standardConverter().convert(map).to(MessagingEndpoint.class) This will honour the defaults from the annotation - see 707.4.4.4.5 of the compendium. The closest link I can give is

Re: [osgi-dev] Bndtools 3.3 enRoute distro update Jetty

2018-05-15 Thread Tim Ward via osgi-dev
Hi Paul, The old enRoute code has been deprecated and is not under active development from anyone at the Alliance. If you would like something fixed then a pull request against the deprecated branch would be the right way to go. For future reference if you want a long-term stable build you

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

2018-05-18 Thread Tim Ward via osgi-dev
What failure are you seeing? Is it still a missing bnd 4.0.0-SNAPSHOT? Obviously while enRoute remains a snapshot (one of its implementation dependencies is still awaiting release) you have to make sure that Maven refreshes snapshots. This means that you: a) need to be online and not

Re: [osgi-dev] Bndtools 3.3 enRoute distro update Jetty

2018-05-15 Thread Tim Ward via osgi-dev
The correct link is https://github.com/osgi/osgi.enroute/blob/deprecated/osgi.enroute.pom.distro/distro-pom.xml Sent from my iPhone > On 15 May 2018, at 09:14, Paul F Fraser via osgi-dev > wrote: > > This does not work for me and the link to the distro pom is dead. >

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

2018-05-15 Thread Tim Ward via osgi-dev
, but I’m on vacation without my laptop. Tim Sent from my iPhone > On 16 May 2018, at 05:43, Paul F Fraser via osgi-dev <osgi-dev@mail.osgi.org> > wrote: > >> On 8/05/2018 8:08 PM, Tim Ward via osgi-dev wrote: >> The enRoute project has now been updated to use

Re: [osgi-dev] Moving from bndtools 3.3 to 4.0.0 with new enRoute

2018-05-21 Thread Tim Ward via osgi-dev
Hi Paul, The video looks good, and I can’t see any problems (i.e. everything looks to be working fine). What is it that you’re expecting to see that you don’t? If you’re worried that you don’t see an index file, then don’t be. The indexer plugin only runs against certain project templates as,

Re: [osgi-dev] Valid DS Component Name?

2018-06-11 Thread Tim Ward via osgi-dev
Hi, The description of the rules is in the first entry of the table here . You will definitely be fine if you stick to ‘.’ as the default naming scheme uses the fully qualified class

Re: [osgi-dev] Adding a Vaadin dependency causes trouble

2018-06-18 Thread Tim Ward via osgi-dev
Hi Paul, > Is there a reason some bundles can not be added as dependencies in the > project (reactor) pom? You should not add dependencies to the parent pom (which in this case is also the reactor pom). The parent pom should be used to manage the versions of common dependencies using the

Re: [osgi-dev] New enRoute Artifacts

2018-06-15 Thread Tim Ward via osgi-dev
Hi Paul, Łukasz, >> Could this be changed to use >> >> groupId + artifactId instead? >> >> Or is there a reason for not doing this? The default package name in the templates is not set by enRoute, it is actually using the “default default” from the Maven archetype system. I don’t actually

Re: [osgi-dev] enRoute Reactor question

2018-06-18 Thread Tim Ward via osgi-dev
Hi Paul, > Is it intended that all modules listed in the reactor are indexed. No, this is not desirable and has been intentionally avoided. Indexes in enRoute are used for running, exporting and resolving. They are not published, and are purely intermediate artifacts. What would the purpose

Re: [osgi-dev] Microservices

2018-06-03 Thread Tim Ward via osgi-dev
The “mistake” here isn’t really a mistake, it is simply a misunderstanding of what the output of the enRoute application archetype is. The application created by enRoute is a stand-alone jar that is designed to be run using java -jar. It is not an OSGi bundle, but instead a Java application

Re: [osgi-dev] Vaadin and New enRoute

2018-07-02 Thread Tim Ward via osgi-dev
It’s a pretty simple type - there’s a blog post here . Fundamentally it lets you get an instance of a service on demand, but you have to release it when you’re done with it. This is good for Vaadin UIs and Views because

Re: [osgi-dev] Vaadin and New enRoute

2018-07-02 Thread Tim Ward via osgi-dev
Hi Paul, Is the QUIProvider instance being used by Vaadin the same as the instance managed by DS? You cannot simply pass the QUIProvider.class to Vaadin for this to work, you need to be able to register the specific component instance. You can see this happening here

[osgi-dev] OSGi enRoute R7 examples

2018-07-03 Thread Tim Ward via osgi-dev
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

Re: [osgi-dev] DB2 OSGI bundle

2018-06-30 Thread Tim Ward via osgi-dev
Sadly IBM have not done the small amount of work needed themselves. The closest you’ll get to a working DataSourceFactory for DB2 is https://github.com/ops4j/org.ops4j.pax.jdbc/tree/master/pax-jdbc-db2 but as the documentation points out at

Re: [osgi-dev] OSGi enRoute R7 examples

2018-07-03 Thread Tim Ward via osgi-dev
aQute.launcher.Launcher" > > Also is the enRoute documentation still to be followed as is, for instance > settings.xml and the cli archetype commands? > > Paul > > On 3/07/2018 7:05 PM, Tim Ward via osgi-dev wrote: >> Hi all, >> >> This is just a heads

Re: [osgi-dev] enRoute - missing documentation after restructuring

2018-05-02 Thread Tim Ward via osgi-dev
Hi Marc, Yes, this was removed on purpose. I’m glad that you found the original page useful (and it will remain in Git history any time you want to refer to it) but it doesn’t align with the goals of enRoute, which are to teach people with little/no OSGi experience to use OSGi, and to promote

Re: [osgi-dev] Regarding service injection

2018-04-26 Thread Tim Ward via osgi-dev
Hi Scott, The answer is really that it depends. The OSGi service registry supports the registration of service instances and service factories. This means that when you see a service registered in the service registry the instance may already exist, or it may only exist as a result of you

Re: [osgi-dev] Proliferation of DS Components and References

2018-01-22 Thread Tim Ward via osgi-dev
Hi Tanvir, I would strongly recommend that you do not use solution A. Static variables are a very bad thing for many reasons, not least (as you have discovered) because they completely bypass the lifecycle management of your component. In answer to the question: "Question: If we set

Re: [osgi-dev] Proliferation of DS Components and References

2018-01-25 Thread Tim Ward via osgi-dev
Hi Tanvir, > Though the example I used is LogService, the issue is for many other > services, such as usage, db access etc > These would be quite different, in that I’m fairly sure that your database access is not optional, and should be using a mandatory reference. > Many examples in the

Re: [osgi-dev] DS Reference injection order

2018-02-02 Thread Tim Ward via osgi-dev
>> 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. >

Re: [osgi-dev] JPA or DB connectivity OSGI

2018-01-02 Thread Tim Ward via osgi-dev
Looks like you beat me to it! There is work happening in enRoute to update this example (and others) but the main points (i.e. the use of transaction control and the JPA service) are OSGi R7 standards and the usage pattern will not change. Regards, Tim > On 2 Jan 2018, at 14:52, Henrik

Re: [osgi-dev] Where is logback referenced in enRoute project artifact

2018-06-20 Thread Tim Ward via osgi-dev
The OSGi enRoute indexes provide a variety of things. The implementation index provides logback as most of the implementations require an SLF4J implementation. https://github.com/osgi/osgi.enroute/blob/master/indexes/impl-index/pom.xml#L271-L289

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] 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] 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] 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] 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] 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-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] 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] 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-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] 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] 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-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
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] 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] 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] 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] 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-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] 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-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] 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.

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] Functions as configuration

2018-07-16 Thread Tim Ward via osgi-dev
I think what you’re looking for is DS! Take the following (apologies for classes typed in email, these may be missing semicolons etc)" @Component(configurationPid=“my.class”, configurationPolicy=REQUIRE) public class MyClass { @Reference ScriptFunction function; // Rest of your

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] Best practice for defining imports and exports

2018-07-05 Thread Tim Ward via osgi-dev
One of the big challenges with optional imports is that they are so rarely actually optional, and that they end up not being wired to you in future if the dependency becomes available as a result of a later bundle installation Every time I see an optional import it tells me that the bundle has

Re: [osgi-dev] Best practice for defining imports and exports

2018-07-05 Thread Tim Ward via osgi-dev
The example that you’ve just given is an excellent candidate for splitting into two bundles. Small bundles are not a sign of bad code, just well-purposed code. Having the servlet in there is a smell because it’s unrelated to the actual purpose of the bundle (namely providing a ready service).

Re: [osgi-dev] DS factory-type pattern

2018-07-04 Thread Tim Ward via osgi-dev
Hi David, There are some approaches that may help, but it’s not 100% clear from this thread which is correct for you because the scenario isn’t fully fleshed out. It appears that you are either: 1) In need of your own specific instance of a common stateful, or otherwise thread unsafe, service

Re: [osgi-dev] Service ranking usage

2018-07-11 Thread Tim Ward via osgi-dev
Note that there is a much prettier (and type safe) way to set the ranking using the @ServiceRanking component property annotation . This will get rid of the ugly property section in your

Re: [osgi-dev] Service ranking usage

2018-07-11 Thread Tim Ward via osgi-dev
Bnd 4.0 and Apache Felix SCR 2.1.0 are both released and support this DS 1.4 feature. It’s used in OSGi enRoute ! Tim > On 11 Jul 2018, at 11:34,

Re: [osgi-dev] Double config

2018-07-13 Thread Tim Ward via osgi-dev
>>>> >>>> Automotive Service Solutions, ESI application (AA-AS/EIS2-EU) >>>> Robert Bosch GmbH | Postfach 11 29 | 73201 Plochingen | GERMANY | >>>> www.bosch.com <http://www.bosch.com/> >>>> Tel. +49 7153 666-1155 | dirk.fa...@de.bosch.

Re: [osgi-dev] Double config

2018-07-12 Thread Tim Ward via osgi-dev
Hi David, > This is a gift! :-) It means your code is not handling the dynamics correctly > and now you know it! I’m not sure that there’s quite enough evidence to come to this conclusion. It could simply be that everything is working fine with a static policy, and working the way that DS is

Re: [osgi-dev] DS factory-type pattern

2018-07-09 Thread Tim Ward via osgi-dev
I’m assuming that this isn’t very close to the actual code. If it is then this has a significant leak. Each time you create a ComponentInstance instance from the ComponentFactory then you must dispose of it when you are done. If you don’t then these instances will accumulate over time. Is the

Re: [osgi-dev] r7 drafts

2018-03-08 Thread Tim Ward via osgi-dev
The constants are in the Constants class, along with the other constants defined in Chapter 100. https://osgi.org/specification/osgi.core/7.0.0/framework.api.html#org.osgi.framework.Constants.INTENT_ASYNC Tim > On 8 Mar 2018, at 20:05, Scott Lewis via osgi-dev >

Re: [osgi-dev] problems with bnd-resolver:resolve

2018-04-23 Thread Tim Ward via osgi-dev
Hi Kevin, Did you do any other kind of build first? My guess is that the problem you have is that you’re skipping ahead in the example. If you’re working purely from the command line then you need to generate the indexes before you can do a resolve. If you go straight for the resolve then the

Re: [osgi-dev] problems with bnd-resolver:resolve

2018-04-23 Thread Tim Ward via osgi-dev
I don’t know what you mean - it clearly always said "mvn verify" ;) Thanks for the bug report. If you do find anything else on the site then feel free to raise bugs against the https://github.com/osgi/osgi.enroute.site

Re: [osgi-dev] Invalid version in bundle org.apache.hadoop.zookeeper=: 3.5.3-beta

2018-04-25 Thread Tim Ward via osgi-dev
Hi Kevin, OSGi version syntax is strictly defined with four sections separated by dots. The first three sections are integers greater than or equal to zero, and the final section (the qualifier) is a String. In this case the org.apache.hadoop.zookeeper “bundle” has a version of 3.5.3-beta,

Re: [osgi-dev] OSGi and Webjars

2018-03-31 Thread Tim Ward via osgi-dev
It wouldn’t take much to make the jars OSGi-friendly, but in the absence of OSGi metadata in the manifest and a service registering them as resources in the HTTP whiteboard then no, they won’t do much. Alternatively you could make them part of a WAB, but that solution sucks. Tim Sent from my

Re: [osgi-dev] enRoute R7 Development Process (was: enRoute R7)

2018-03-20 Thread Tim Ward via osgi-dev
re? I am getting no response to my pull >> request on GitHub. >> >> I would like to ping a committer, or something, but I don’t understand how >> the project is being managed. >> >> >> Cheers, >> =David >> >> >>> On Feb 26, 2018, a

Re: [osgi-dev] enRoute R7

2018-02-26 Thread Tim Ward via osgi-dev
Hi Jim, Sorry for the delay in responding to this - I’ve been away for the last couple of weeks. Yes - there is an enRoute R7 coming. The official release of enRoute has to wait for the official release of the OSGi R7 specifications and Reference Implementations. Currently the R7

Re: [osgi-dev] Vaadin and New enRoute

2018-06-29 Thread Tim Ward via osgi-dev
Hi Paul, > The MainUI references all of the ComponentServiceObjects used in the project. > > Could you suggest how this would be handled when new types need to added at > runtime. The Views are just prototype scope services. You could easily use a whiteboard for them and find them based on

Re: [osgi-dev] enRoute spending long time Checking index project

2018-06-20 Thread Tim Ward via osgi-dev
I’m cross posting this to the bndtools list, as I would suggest that is a more appropriate forum for Bndtools specific IDE questions than the general OSGi Dev List. Perhaps the discussion will continue there. > Build automatically.. On or Off I always have "Build Automatically” on. It gives

Re: [osgi-dev] Vaadin and New enRoute

2018-06-28 Thread Tim Ward via osgi-dev
Hi Paul, I’m glad to hear that this is working. It does look like it could use a little tidying up though. The overall approach seems similar to that used in the OpenSecurityController project, although that is even more decomposed into services, and might be a better model follow up. The UI

Re: [osgi-dev] Non OSGi jars

2018-06-28 Thread Tim Ward via osgi-dev
Using 3rd party code in your OSGi bundle is possible in a number of ways. Firstly, in most cases someone has already done the work. The Apache ServiceMix project contains a large number of OSGi-ified jar files. Newer versions of libraries have often been updated to include OSGi metadata, and

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

2018-06-29 Thread Tim Ward via osgi-dev
Hi Henrik, This should really be raised on the bndtools list, and I am cross-posting there. > For the Service-Component header I had to fill in every component > instead of * > No big deal, but kind of tedious. In a bndtools 4.0.0 workspace you shouldn’t need a Service-Component header at all

Re: [osgi-dev] Best practice for refactoring to DS

2018-06-29 Thread Tim Ward via osgi-dev
> On 29 Jun 2018, at 14:57, Alain Picard wrote: > > > Thanks Tim, see below. > > On Fri, Jun 29, 2018 at 8:12 AM Tim Ward > wrote: > Hi Alain, > >> 1) How to deal with references in classes that are not service and that have >> constructor arguments (and not

Re: [osgi-dev] OSGi Specification Question

2018-06-28 Thread Tim Ward via osgi-dev
I think it is this picture that causes the confusion: In this picture the “register” action is between A and S. This appears to suggest that the service S is registered

Re: [osgi-dev] Best practice for refactoring to DS

2018-06-29 Thread Tim Ward via osgi-dev
Hi Alain, > 1) How to deal with references in classes that are not service and that have > constructor arguments (and not basic type supported by config admin) since > this can't be turned directly into a component? It depends on the constructor really. You can either have a DS component which

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] 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] 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] 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] 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] 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] 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] 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] 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] 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,

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] 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

[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] 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-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] 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] 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] 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] 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] 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

  1   2   >