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

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

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

<    1   2