osgi

How to convert jar to OSGi bundle using eclipse and bndtools

风格不统一 提交于 2019-11-27 20:16:04
I am looking for a step by step guide to convert jar into an OSGi bundle using the eclipse bndtools plugin. I know it is possible to do it with bnd using the command line but would be nice to know how to do the same via the IDE. I might be missing something but this tutorial only explains how to create a project from scratch. Follow the article Create Eclipse plugins (OSGi bundles) from standard jar to achieve this. Though this approach does not use Bnd, but you would be able to achieve what you want. In short you can do following: Create a new Plugin project by selection File-> New -> Project

When is an OSGi fragment attached to host?

允我心安 提交于 2019-11-27 16:06:20
问题 I have an OSGi bundle with persistence service (using hibernate ) and a fragment, which contains configuration (xml file). In bundle's activator, I'm loading the configuration using: @Override public void start(BundleContext ctx) { URL url = ctx.getBundle().getResource("hibernate.cfg.xml"); SessionFactory sessionFactory = new AnnotationConfiguration().configure(url).buildSessionFactory(); } but sometimes, the URL is null. When I've tried to list all available URL s (using findEntries method),

Web Application using OSGi and GWT

让人想犯罪 __ 提交于 2019-11-27 14:48:28
问题 Which is a good architecture for a Web Application using OSGI and GWT as UI? The aim is to use bundles to make bundles of web interface sections. If I add new bundle it will add new features (a menu for example) on the user interface, which cooperate with existing ones. 回答1: Please see a similar discussion on the GWT mailing list - http://groups.google.com/group/google-web-toolkit/msg/4a3f912cb89a7256 To summarize - GWT's architecture is orthogonal to your requirement of multiple modules

Best way to shutdown an OSGi Container (specifically equinox)

半腔热情 提交于 2019-11-27 14:36:02
问题 I'm looking for a best practice on shutting down an OSGi container. Currently we are using a small launcher app which calls EclipseStarter.startup() and installs some core bundles. After that the launcher terminates. When the test GUI (running as a bundle) is closed it calls a System.exit(0) to shutdown the container, but there must be a more elegant solution than this. Thanks 回答1: Please, don't use System.exit(0) to shut down an OSGi framework. You should to it by stopping the bundle with

OSGi Declarative Services vs. ManagedService for configuring service?

丶灬走出姿态 提交于 2019-11-27 13:59:48
问题 I just recently stumbled upon the fact that Declarative Services in OSGi can set the configuration of a component to required so that the component receives it upon activation, removing the gap between component activation and configuration. I also realized with this that you can receive configuration updates via the modified -method. It seems to me like this functionality is quite similar to that provided by implementing the ManagedService interface and publishing that as one of the

Which Rich Client Platform to use

徘徊边缘 提交于 2019-11-27 13:06:23
问题 We recently started to develop a Java desktop app and management has requested that we make use of Rich Client Platform. I know of four for Java namely: Eclipse RCP - www link to ecipse rcp, Netbean RCP - Netbeans RCP web site, Spring RCP - spring rich client Valkyrie RCP - Valkyrie rich client Has anyone got any experience in any of these and if so what are the strength and weaknesess of each? thanks 回答1: I recommend that you take a look at JSR 296 - it's not complete yet by any stretch, but

How to create OSGi bundle from jar library?

别说谁变了你拦得住时间么 提交于 2019-11-27 12:46:23
How to create OSGi bundle from jar library? In case you are using eclipse: There is a wizard for that. It allows you to select a number of jar libraries and creates a plug-in project (i.e. OSGi bundle) including these jars. You can find it here: File -> New -> Other ... -> Plug-in from Existing jar Archives. In principle you just need to add OSGi metadata to the manifest There is a bundle creator for eclipse which gives a very practical way to add these entries which should be part of the Plugin Dev Toolkit. Here is an article detailing the process and how to do it with the Bnd tool, maven and

Java 8 & Missing required capability Require-Capability: osgi.ee; filter=“(&(osgi.ee=JavaSE)(version=1.8))”

99封情书 提交于 2019-11-27 11:55:00
I have using Eclipse Luna win32.x86_64 runing with Java 8. Here from the Help Menu > About > Installation Detail > Configuration Tab : java.runtime.version=1.8.0_05-b13 java.version=1.8.0_05 I have created new plug-in project, requesting JavaSE-1.8 as Execution Environment: In the myplugin/META-INF/MANIFEST.MF file I have of course: Bundle-RequiredExecutionEnvironment: JavaSE-1.8 I use this plugin in a product file. When I try to validate it, I get following error: Of course if I start the product, I get: !ENTRY org.eclipse.osgi 2 0 2014-07-10 08:14:22.042 !MESSAGE One or more bundles are not

When should I use Import-Package and when should I use Require-Bundle?

梦想与她 提交于 2019-11-27 11:32:47
OSGi allows for dependencies to be determined via Import-Package , which just wires up a single package (exported from any bundle), and Require-Bundle , which wires up to a specific named bundle's exports. In building a greenfield OSGi application, which approach should I use to represent dependencies? Most of the bundles will be internal, but there will be some dependencies on external (open-source) bundles. Thilo I believe Require-Bundle is an Eclipse thing (that has now made it in the OSGi spec to accommodate Eclipse). The "pure" OSGi way is to use Import-Package , as it specifically

OSGI - handling 3rd party JARs required by a bundle

喜欢而已 提交于 2019-11-27 11:27:16
I'm just getting started with OSGI development and am struggling to understand how best to handle dependant JARs. i.e. if I'm creating a bundle the likelyhood is that I will need to use a few 3rd party JARs. When I create my bundle JAR to deploy to OSGI, obviously these 3rd party JARs are not included and thus the bundle will not run. I understand that one option is to turn these JARs into bundles and also deploy them to the OSGI container. However if they only need to be used by the one bundle this doesn't seem ideal. What is the best solution to this? Can the JARs be embedded within the