osgi

Existing implementations of OSGi Configuration Admin Service?

对着背影说爱祢 提交于 2019-12-04 02:31:52
We are considering to use Configuration Admin Service as a primary API for configuring components in our OSGi-based application. It would be nice if we could reuse some existing implementation so I'm trying to investigate and evaluate the most popular ones. I know there is: Apache Felix Config Admin (org.apache.felix.cm) Equinox Config Admin (org.eclipse.equinox.cm) Are there any other implementations to be considered? Also I was not able to find any good documentation for these implementations. I would be mainly interested in the implementation-specific details. For example I was wondering

Which dependencies do I need to use Mockito and JUnit in an Eclipse RCP Tycho project

☆樱花仙子☆ 提交于 2019-12-04 02:29:43
This is my current test fragment: <packaging>eclipse-test-plugin</packaging> <dependencies> <dependency> <groupId>org.junit</groupId> <artifactId>com.springsource.org.junit</artifactId> <version>4.7.0</version> </dependency> </dependencies> with the following plugins configuration: <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-surefire-plugin</artifactId> <version>${tycho.version}</version> <configuration> <dependencies> <dependency> <type>p2-installable-unit</type> <artifactId>org.eclipse.equinox.ds</artifactId> </dependency> <dependency> <type>p2-installable-unit</type>

What does the private-package manifest header do?

天涯浪子 提交于 2019-12-04 01:51:18
I am familiar with Import-Package and Export-Package , but this is a new one for me. What does it do? At runtime in the OSGi container it does nothing. In fact, it's not even mentioned in the OSGi specification (I checked R4). However, it can be specified in a .bnd file for use by bnd at build time. If so, it can be used to determine what goes into the bundle. When bnd builds a bundle, it automatically determines which classes need to go into the bundle. All the classes in packages that are exported are included, and all the classes that they depend on (transitively) are included too. This

Package uses conflict: Import-Package on startup of a bundle

微笑、不失礼 提交于 2019-12-04 00:48:59
I am getting the following error when trying to install the htmlunit bundle: com.springsource.com.gargoylesoftware.htmlunit_2.6.0 [370] could not be resolved. Reason: Package uses conflict: Import-Package: org.apache.commons.logging.impl; version="1.1.1" I have followed the diagnostic procedure for this type of problem on this blog . And here are my findings: The bundle com.springsource.com.gargoylesoftware.htmlunit_2.6.0 has the following instructions: Import-Package: \ org.apache.commons.logging;version="[1.1.1, 2.0.0)",\ org.apache.commons.logging.impl;version="[1.1.1, 2.0.0)" The only

How to auto-start/eager start OSGi services on Eclipse platform

五迷三道 提交于 2019-12-04 00:48:36
问题 I develop an Eclipse RCP application which makes heavy use of OSGi bundles which provide services for later use. The use case requires the bundles to register their services (e.g. import filters) to be used later on in different situations. The OSGi bundles are build with maven-bundle-plugin. How can I tell Equinox to start the OSGi bundles automatically? The normal approach via Activator is not working. Only the lazy mode is working, but I can not touch classes within unknown bundles. I read

How do I access a file inside an OSGi bundle?

蓝咒 提交于 2019-12-03 23:41:49
I am new to OSGi and created an OSGi-bundle which I run in the Apache Felix OSGi-container. There is a file resource contained in the bundle, which I need to pass to a method as a java.io.File . To instantiate a File-object, either an URI in the "file"-scheme or the path as string is necessary. How do I retrieve any of those in a clean way? I tried using the context.getBundle().getResource("/myfile") (where context is of type org.osgi.framework.BundleContext ) which returns the URI bundle://6.0:0/myfile . But this URI can't be converted to a File-instance using the File(URI uri) constructor

Using Java 7 Comparators in Java 8

∥☆過路亽.° 提交于 2019-12-03 23:01:32
Situation I have an OSGi project that I'm trying to migrate to Java 8. In my project, I have dependencies to third party libraries that I "OSGi-fied" (by just adding the MANIFEST.MF file and putting metadata into it). These libraries are checked out from read-only SVN repositories, so I just can checkout updates from then when needed and therefore I don't want to make any other changes than in the MANIFEST.MF file, since I cannot commit them. Problem However, these libraries use lots of anonymous Comparators like: private static final Comparator heightComparator = new Comparator() { public int

Camel in OSGi Container: Apply InterceptStrategy to all camel contexts

隐身守侯 提交于 2019-12-03 22:18:48
I have several bundles (A, B, and C) deployed to an OSGi container, each containing a CamelContext and some routes. I have another bundle (M) with a CamelContext with a route (for collecting monitoring data) and a InterceptStrategy bean. I would like the InterceptStrategy bean from M to automatically apply to all of the other CamelContext s in the container (i.e., those in A, B, and C), without having to modify the other bundles. Ultimately, the goal is to wiretap data from each CamelContext into the route in M, without having to make any changes to A, B, or C to explicitly route the Exchange

logback in spring-OSGI with pax-runner

戏子无情 提交于 2019-12-03 21:54:56
We are running OSGI bundles with pax-runner. We are logging using logback over slf4j. The problem is logback tries to look for logback.xml in classpath, but in pax-runner where should I place logback.xml so that pax-runner configure logback accordingly? I have tried with JoranConfigurator to load logback.xml which is included in bundle classpath, but it assumes classpath as the container in which the bundle is running (in my case it is runner folder where all the bundle jars are placed). Any help would be appreciated. Thanks in advace. The usual approach would be to create a fragment bundle

How to reference an included file in OSGi bundle when performing java.io.File or FileInputStream

依然范特西╮ 提交于 2019-12-03 19:56:24
问题 I am using the aQute Bnd toolset to create an OSGi bundle and have packaged with some dependant 'resource' files. This includes *.css files and *.xsd files in a resources directory I have created. I have included the following in the bundle.bnd file: Include-Resource: resources/=resources/ and when I do a build, the generated *.jar file has the *.css and *.xsd files in the resources directory in the top directory of the jar bundle file. However, in the actual code I am having difficulty in