users@grizzly.java.net

Re: OSGi support was Re: [ANN} New Grizzly sub-project: grizzly-config

From: Ray Racine <ray.racine_at_gmail.com>
Date: Sat, 22 Nov 2008 07:44:02 -0500

One thing I do is build my own monolithic Grizzly from the constituent jars.
I embed the Grizzly with a customer Adapter in my project and I needed some
stuff which was not exported from the pre-built Grizzly bundles.

The following Maven2 POM fetches the Grizzly jar set and builds a
mono-bundle/jar which has the added advantage of a one bundle install in
Felix.

I do get split package warnings when building the mono-bundle.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>sun.com.sun.grizzly</groupId>
  <artifactId>grizzly</artifactId>
  <packaging>bundle</packaging>
  <version>${grizzly.version}</version>
  <name>OSGi Grizzly - Sun</name>
  <url>http://github.com/GreyLensman/crank/tree/master</url>

  <properties>
    <grizzly.version>1.8.6.1</grizzly.version>
  </properties>

  <repositories>

    <repository>
      <snapshots>
    <enabled>true</enabled>
      </snapshots>
      <id>java.net</id>
      <name>Sun's Java Net Maven2 Repository</name>
      <url>http://download.java.net/maven/2</url>
      <layout>default</layout>
    </repository>

  </repositories>

  <dependencies>

    <dependency>
      <groupId>com.sun.grizzly</groupId>
      <artifactId>grizzly-framework</artifactId>
      <version>${grizzly.version}</version>
    </dependency>

    <dependency>
      <groupId>com.sun.grizzly</groupId>
      <artifactId>grizzly-http</artifactId>
      <version>${grizzly.version}</version>
    </dependency>

    <dependency>
      <groupId>com.sun.grizzly</groupId>
      <artifactId>grizzly-rcm</artifactId>
      <version>${grizzly.version}</version>
    </dependency>

    <dependency>
      <groupId>com.sun.grizzly</groupId>
      <artifactId>grizzly-http-utils</artifactId>
      <version>${grizzly.version}</version>
    </dependency>

    <dependency>
      <groupId>com.sun.grizzly</groupId>
      <artifactId>grizzly-portunif</artifactId>
      <version>${grizzly.version}</version>
    </dependency>

  </dependencies>

  <build>

    <plugins>

      <plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
      <instructions>
        <Export-Package>
          com.sun.grizzly.tcp,
          com.sun.grizzly.http,
          com.sun.grizzly.util.buf,
          com.sun.grizzly.util.http,
          com.sun.grizzly.tcp.http11
        </Export-Package>
        <Private-Package>
          !com.sun.grizzly.tcp,
          !com.sun.grizzly.http,
          !com.sun.grizzly.util.buf,
          !com.sun.grizzly.util.http,
          !com.sun.grizzly.tcp.http11,
          com.sun.grizzly.*
        </Private-Package>
      </instructions>
    </configuration>
      </plugin>

    </plugins>
  </build>
</project>

R.



On Fri, Nov 21, 2008 at 11:46 PM, Richard Jackson <richard.jackson_at_gmail.com
> wrote:

> I think as long as you don't export the same package/class you are ok
> in OSGi but I will take a look as well. As The question made me
> curious. I've been reading the spec (but mostly looking at the
> HTTPService spec section).
>
> Richard
>
> On Fri, Nov 21, 2008 at 4:50 PM, Jeanfrancois Arcand
> <Jeanfrancois.Arcand_at_sun.com> wrote:
> > Salut,
> >
> > Oleksiy Stashok wrote:
> >>
> >> Hi guys,
> >>
> >> what about repackaging issue, which we have currently for OSGi GF
> >> integration? If I understand correctly, different Grizzly OSGi modules
> shold
> >> not export same packages?
> >> Shouldn't we fix this first before doing other steps?
> >
> > I think only GF suffer that problem (not sure why). I was able to load
> > Grizzly's module with Felix without any issues. I need to investigate
> > more...
> >
> > A+
> >
> > -- Jeanfrancois
>
>