osgi

What OSGi tutorials are there for learning how to build modular Java applications?

What tutorials would you recommend for learning about modular Java with OSGi, and advice on how to write decoupled systems by decomposing them into modules? What level of granularity is right; a big bundle with everything, lots of very little bundles with one specific task, or somewhere in between? ...

Different osgi bundles with implementations of the same interface - where to place that inferface?

I'm currently testing out osgi (Spring DM) on a new application. The application needs to be able to listen to file system events. Today I've solved this with a simple time based poller, but when Java 7 is released I probably want to replace that with a NIO2 based implementation. So far I'm looking at three bundles, two for the file se...

When to use ServiceLoader over something like OSGi

Being someone who is allergic to dependencies, when would I use something like OSGi instead of the built in java 6 http://java.sun.com/javase/6/docs/api/java/util/ServiceLoader.html (I want to let plugin jars just be dropped in). (FYI this is in a scala app, open to any suggestions, ServiceLoader is pretty damn close to what I want). ...

OSGi : How can a Service auto discover client bundles deployed at runtime?

Hi, I have a scenario where during the system install time, a few services were deployed on to the OSGi container and these services will be listening for other bundles that provide data and are dynamically installed and uninstalled at runtime. These data providers do not expose any services and should not even invoke services; my id...

Declarative Vs Bluprint Services in OSGi

What is the difference between Declarative and Bluprint Services in OSGi? as both are aim to achieve Dependency injection in osgi. Is blueprint services is alternative to declarative services? or bluprint services fills the limitations (if any) of declarative services? ...

Quick Turnaround with Maven and OSGi

I'm looking for a developmentn model with fast turnaround times when developing a multi-module, maven built, OSGi application. Actually, the best solution seems to be Pax Construct's maven plugin (which in turn calls Pax Runner) for provisioning maven generated bundles. However, I didn't find a way howto deploy to a running OSGi contain...

Transitive dependencies on bundles?

Hi, when using bundle as the packaging of a maven artifact, I seem to lose all information about transitive dependencies. So if artifact A depends on artifact B and B is packaged as a bundle, A does not see the maven dependencies that B has. This leads to lots of issues with maven plugins used in A's POM that need this information (such...

OSGi or Impala ?

I have been deep-divining in osgi from past few months and must say impressed by it. In recent days I saw one blog saying that impala is better than osgi. I heard about impala but never got a chance to deep-dive into it. I just want to know that which one better Impala or OSGi? Is anyone is working on impala? For developing large ente...

Can't find service because OSGi bundle isn't activated

I'm having a problem discovering services that are provided by some OSGi bundles that are not being activated. Let me describe the situation: Bundle A defines interface X Bundles B, C, and D provide services that implement interface X These bundles' services are registered via Spring DM, so they are only created when the bundle is ac...

Java Unit Test: Replace a private method under test

Is there any way of replacing the logic within a private method when running a JUnit test? A bit of background: we have some private methods which interact with bundles within an OSGi container. This is not available in the unit test therefore the methods will fail. We have looked at JMockIt but the method replace functionality seems t...

OSGI - Hibernate + JBoss Seam

Hi all, I am running a JBoss Seam web application with Hibernate as the persistence provider. I am considering migrating to OSGI to simplify deployment and updates. I don't have any experience yet with OSGI, so I don't know if this can be done and what the limitations are. For instance, if I change entity classes and I want Hibernate...

Running multiple versions of a servlet web application parallel

I want to run multiple versions (like myapp2.1, myapp2.2 ...) of several Java Servlet based web applications parallel. One possibility could be to deploy each version to a separate servlet context (which should have its own class loader?!). But I think it will be hard to manage and won't be flexible, since an application is a quite larg...

Is the resolution problem in OSGi NP-Complete?

The resolution problem is described in the modularity chapter of the OSGi R4 core specification. It's a constraint satisfaction problem and certainly a challenging problem to solve efficiently, i.e. not by brute force. The main complications are the uses constraint, which has non-local effects, and the freedom to drop optional imports t...

Resteasy client in an OSGi / Eclipse RCP environment

I'm trying to build a client for a Resteasy service in Eclipse. I thought this would be simple - but a lot of the magic that Resteasy does (e.g. looking up annotations on POJOs, loading the Resteasy providers, etc.) seems to be broken by the OSGi class loader. I've spent quite a bit of time resolving the problems with dependencies and bu...

Implementing dynamic plugins in Java

I'd like to implement a dynamic plugin feature in a Java application. Ideally: The application would define an interface Plugin with a method like getCapabilities(). A plugin would be a JAR pluginX.jar containing a class PluginXImpl implementing Plugin (and maybe some others). The user would put pluginX.jar in a special directory or se...

How to package and consume an existing Java library with OSGI

Hi, After asking for help for managing dependencies on different versions of the same libraries in Java, it was suggested that I should take a look at OSGI implementations. Being under a deadline pressure, I could really use some help that would save me from digging through endless OSGI docs. I have a working app, which is going to use...

eclipse.buildscript building a platform specific feature on the wrong platform

I have a feature and plugin called foo, and both are win32 platform specific; however, when I call the following in my ANT script on a linux, gtk, x86 system, the feature is built, but the plugin isn't (correct). <eclipse.buildScript elements="feature@foo" configInfo="${os},${ws},${arch}" buildDirectory="${edge.build.eclipse.loc}" baseL...

Is JSF available as an OSGi (Equinox) bundle?

There is a bundle for JSP/JSTL, which can be deployed on Equinox OSGi Framework and can be used by other bundles then: org.eclipse.equinox.jsp.jstl_1.0.0.jar Is there also a bundle for JSF, so i can use JSF components in my bundles? I really need to solve this issue, because i have to transform an extisting JSF Web Application to an O...

Can OSGi help reduce complexity?

I saw lots of presentations on OSGi and i think it sounds promising for enforcing better modularization. Apparently "hotdeployment" and "running different versions of x in parallel" are mayor selling points too. I wonder whether what OSGi promises to solve is even an issue...? It reminded me of the early days of OO when similar claims w...

Better handling of Thread Context ClassLoader in OSGi

I've been using OSGi for a while now and I have various solutions to the problems I encountered. I wanted to revisit one of these and see if people had come up with different solutions. One of the most common issues I have with OSGi (Equinox 3.4.2) is the frequent unavailability of the Thread's context ClassLoader. I know this is partly...