osgi

eclipse library bundle - fails to export packages from some libraries

南笙酒味 提交于 2019-11-30 15:40:59
I've created a simple plugin project in eclipse 3.5 that just stores third-party libraries for the use by other bundles in an eclipse RCP application. Worked as expected: I edited the manifest, exported the required packages and added the libraries to the build path (project build path as well as manifest build path). Some days later I added another jar to that project, did the same steps (exporting a package, adding the library to the build path(s)) but this time I can't import classes from that exported package in other bundles. The package was clearly selectable on the manifest editor but

OSGI Valid Version Ranges

这一生的挚爱 提交于 2019-11-30 15:04:46
问题 Currently I'm trying to implement OSGI Version Ranges (for a different topic, but I like the way they define version ranges). However I'm having a hard time to find the specific Definition of a Version Range in OSGI. Unfortunately, the OSGI API does contain a Version class but not a VersionRange class. It seems like all OSGI Containers come up with their own interpretation of the (somewhat unfindable) Version Range definition. Therefore I have several questions: If I used versionRange=1.4.0 ,

Eclipse: OSGI Preferences vs. PreferenceStore

﹥>﹥吖頭↗ 提交于 2019-11-30 15:04:22
问题 I'm working on an Eclipse plugin (or in fact, a plugin for an Eclipse-based application) which needs some configuration to be entered by the user. From looking at the documentation, there seem to be two preference APIs - one in org.eclipse.core.runtime.preferences, extending/implementing the OSGI prefererence API, another one, JFace specific, in org.eclipse.jface.preference. Then we have org.eclipse.ui.preferences, too. The OSGI API has a hierarchic Node tree - a preference node ( Preferences

[插件化开发] 1. 初识OSGI

[亡魂溺海] 提交于 2019-11-30 14:57:50
初识 OSGI 背景 当前product是以solution的方式进行售卖,但是随着公司业务规模的快速夸张,随之而来的是新客户的产品开发,老客户的产品维护,升级以及修改bug,团队的效能明显下降,为了解决此类问题,必须站在公司战略的统一高度来重构系统。 荣幸的是,本人在此时加入团队并负责系统架构的升级与重构工作。因为公司在全世界都有客户,而且客户又来自于各行各业,带来的问题就是如何抽离公共业务的同时,又能不影响客户的定制化需求开发?产品团队专注于系统的核心逻辑开发,而一些定制化需求交付给global team 去开发? 选型 技术没有银弹,目前没有完全确定要使用OSGI的方式来实现,因为本人之前使用Spring Cloud & Spring Cloud Alibaba各实现了一种demo, 当然也可以实现我们的服务化,高可用以及动态扩展。但是在解决插件定制化这块,相对来说还是不太熟悉,然后OSGI进入眼帘了。 OSGI 简介 OSGI 是 <u>O</u>pen <u>S</u>ervice <u>G</u>ateway <u>I</u>nitiative(开发服务网关协议)。 指维护OSGI规范的官方联盟 > OSGi Alliance是一个由Sun Microsystems、IBM、爱立信等于1999年3月成立的开放的标准化组织,最初名为Connected Alliance。

Determine runmode in Adobe CQ

痴心易碎 提交于 2019-11-30 14:50:05
问题 How do I programmatically know which run-mode the instance is running? I created a custom tag that provides the config depending on the instance run-mode, but I can not determine the current run-mode. I found a method that returns a list of run-mods instance: SlingSettings settings = ...get from BundleContext... Set<String> currentRunModes = settings.getRunModes(); But I can not get the objects SlingSettings or BundleContext. How can I get these objects or perhaps there is another way to get

Including additional resources with OSGi bundles

淺唱寂寞╮ 提交于 2019-11-30 14:45:47
I'm working on an OSGi bundle which implements a service as a wrapper around a native executable. That is, the service runs the executable with ProcessBuilder , feeds it some data, and retrieves the result. My question is about the best way to package this bundle. The native executable includes a number of dependent data files which all must be present on disk for the tool to run. I've found plenty of references on dealing with native DLLs in OSGi, but none that address files associated with a bundle that must be present on disk rather than just retrievable through the classpath. I was

Search OSGI services by properties

倾然丶 夕夏残阳落幕 提交于 2019-11-30 14:42:13
问题 How can I distinguish between published OSGI services implementing same interface by their properties? 回答1: Assuming that you want to retrieve registered services based on certain values for properties, you need to use a filter (which is based on the LDAP syntax). For example: int myport = 5000; String filter = "&(objectClass=" + MyInterface.class.getName() + ")(port=" + myport + ")"; ServiceReference[] serviceReferences = bundleContext.getServiceReferences(null,filter); where you want to

OSGI missing requirement error

怎甘沉沦 提交于 2019-11-30 14:10:54
问题 I am new to OSGI and I am trying to figure out how I resolve errors such as the one below org.osgi.framework.BundleException: Unresolved constraint in bundle org.foo.serviceBundle [253]: Unable to resolve 253.0: missing requirement [253.0] package; (&(package=org.slf4j)(version>=1.6.0)(!(version>=2.0.0))) I used a maven archetype to generate a bundle and added some simple slf4j logging to my Activator class. I am also using the maven bundle plugin as follows: <plugin> <groupId>org.apache

Run osgi bundle from command line

微笑、不失礼 提交于 2019-11-30 13:19:40
问题 I developed an OSGi bundle, which I usually test from Eclipse. Aftrer exporting the bundle, I get a bundle.jar file. I would like to be able to run the generated file from the command line. Something like: C:\java -jar bundle.jar osgi_framework path But, how to include the osgi framework in it? and also, how can I start the bundle immediately? 回答1: You can start the OSGi framework from the command line as follows. First for Equinox: java -jar org.eclipse.osgi_VERSION.jar -console NB.

Eclipse: OSGI Preferences vs. PreferenceStore

扶醉桌前 提交于 2019-11-30 12:47:51
I'm working on an Eclipse plugin (or in fact, a plugin for an Eclipse-based application) which needs some configuration to be entered by the user. From looking at the documentation, there seem to be two preference APIs - one in org.eclipse.core.runtime.preferences , extending/implementing the OSGI prefererence API , another one, JFace specific, in org.eclipse.jface.preference . Then we have org.eclipse.ui.preferences , too. The OSGI API has a hierarchic Node tree - a preference node ( Preferences or IEclipsePreferences ) can have multiple subnodes, which themselves can contain both individual