Paul Plato
Paul Plato

Reputation: 1499

Osgi with Java EE 6 Getting started

I am trying to develop a service where in all the different stacks e.g Persistence, Security, etc. run as OSGi bundles in an OSGi container. I am using JBoss AS 7.1.1 as my OSGi container.

I used the following JBoss stack to setup my project.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.bom</groupId>
            <artifactId>jboss-javaee-6.0-with-osgi</artifactId>
            <version>1.0.3.Final</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

However, I was thinking the Manifiest.MF as well as activator classes will be auto-generated (not that i have a problem doing this), but to my surprise, nothing happens and I am bumped on that.

Also i cannot figure out how to wire services provided by different OSGi bundles together in a web application.

Most of the examples I see are targeting a Spring environment. Please, could someone point me in the Java EE 6 direction?

Upvotes: 1

Views: 671

Answers (1)

Holly Cummins
Holly Cummins

Reputation: 11492

Your best bet for wiring is probably Blueprint. Blueprint can also replace Activators with eager singleton beans. Blueprint can't be used directly within the web bundle to register and consume services, but a JNDI-Blueprint bridge allows you to use JNDI lookups with an 'osgi:service' namespace.

You can find plenty of Blueprint and Enterprise OSGi tutorials if you google for Apache Aries, and you may find Enterprise OSGi in Action useful. Chapters 1 and 2 are available free on the web.

Upvotes: 3

Related Questions