osgi

eclipse library bundle - fails to export packages from some libraries

天大地大妈咪最大 提交于 2019-12-18 17:30:09
问题 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

Eclipse Extensions and Declarative Services

老子叫甜甜 提交于 2019-12-18 17:30:01
问题 I'm a little confused on the approach to extensions/services in the Eclipse architecture. There are two options available to a developer: The use of Eclipse plugin extensions - http://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html The use of declarative services - http://www.eclipse.org/equinox/bundles/ When you would use one over the other and what are the advantages and the disadvantages of each approach? Also going forward which is the preferred approach?

Run Apache Felix 4.0.2 in IntelliJ IDEA 11

≡放荡痞女 提交于 2019-12-18 16:52:10
问题 According to this post, IDEA uses Osmorc to run OSGi frameworks. It, in turn, uses Pax Runner to launch different framework implementations. The toolchain in IDEA 11 can only run Apache Felix up to 3.0.2, but I have to run version 4.0.2. Is it possible? Do other OSGi framework launchers exist for IDEA? 回答1: You can configure the OSGI frameworks that Osmorc uses from the plugin+ project settings. I use IntelliJ IDEA 11.1.2 and Osmorc 1.4.2. Here is a screenshot where I configure the OSGI

Using OSGi to implement auto-update

戏子无情 提交于 2019-12-18 15:10:34
问题 What I'd like to do is create a "launcher" framework for my code that, given a URL and a predefined versioning scheme: 1) go check if an update exists 2) download the updates 3) "install" the update 4) "re-run" the application I want to a) do all of this inside of the existing JVM and b) be platform independent. Tall order right? Based on my (limited) knowledge of OSGi and Apache Felix I'm pretty sure this is possible, but I'm really getting lost in the details. Checking for an update and

Java: Dynamically Load Multiple Versions of Same Class

我与影子孤独终老i 提交于 2019-12-18 13:29:50
问题 What I'd like to be able to do is to load set of classes, probably all in the same folder. All of which implement the same interface and are the same class, then in my code I'd like to be able to call functions on those classes. 回答1: Based on your answer to my question, it seems you want to define a game interface and then plug in any number of AI implementations, probably configured from a .properties file. This is fairly standard use of an API interface. You define an EngineInterface

Java: Dynamically Load Multiple Versions of Same Class

爷,独闯天下 提交于 2019-12-18 13:28:04
问题 What I'd like to be able to do is to load set of classes, probably all in the same folder. All of which implement the same interface and are the same class, then in my code I'd like to be able to call functions on those classes. 回答1: Based on your answer to my question, it seems you want to define a game interface and then plug in any number of AI implementations, probably configured from a .properties file. This is fairly standard use of an API interface. You define an EngineInterface

accessing command-line arguments from OSGi bundle

早过忘川 提交于 2019-12-18 13:23:09
问题 I have an application that runs as a collection of OSGi bundles. I start it using a very small wrapper that embeds the Felix framework. The necessity of that wrapper irks me a little, as does the fact that it depends on Felix (whereas the application itself could run just as well in, say, Equinox), so I want to get rid of it, and use the default Felix launcher. The only thing that the wrapper really does is passing the command line arguments into the launched OSGi framework, so that a bundle

Where can I find Spring 4 OSGi bundles

余生长醉 提交于 2019-12-18 12:51:04
问题 Where can I find OSGi bundles for Spring 4? I checked http://ebr.springsource.com/ but can only find Spring 3.2.x and the artifacts in Maven Central are not bundles. Clarification I'm not looking for Spring DM or similar. I'm looking for the "Spring Framework" JARs (spring-core, spring-beans, spring-context, …) as OSGi bundles. I'm not trying to create an application context in an OSGi environment. I just need the (exception) classes in an OSGi environment. 回答1: Spring will NOT support any

Tycho and Eclipse: How to resolve OSGI dependencies to my own bundles at development time within Eclipse, without opening all of them in the IDE

巧了我就是萌 提交于 2019-12-18 10:56:18
问题 Background My Eclipse RCP application is built using Tycho. It consists of multiple components (in the form of OSGi bundles/Eclipse plug-ins). One of these component contains the product file and materializes the product. There is a reactor POM at the application root, which builds all components in order, but I also want to build other components independently (using mvn deploy ) . Building such a single component works as follows: Retrieve the latest versions of all the component's

Best technique for getting the OSGi bundle context?

对着背影说爱祢 提交于 2019-12-18 10:48:27
问题 Each bundle in my OSGi project has its own BundleActivator, which I think is normal. This gets passed the current BundleContext, which is useful to have around for getting service references and whatnot. However, from classes in my bundle, how can I get the BundleContext? Assigning it to a public static field in the BundleActivator sucks and passing it around as an argument also sucks. Is there a more intelligent way? 回答1: You can use FrameworkUtil.getBundle(ClassFromBundle).getBundleContext(