xnio/xnio — pull request #11 by marschall (2013-04-01 17:35:43+00:00)
Title: XNIO-195 Make XNIO an OSGi Bundle

We'd like to use XNIO in an OSGi environment (Equinox). Therefore it
would be convenient if XNIO was already a bundle (or two).

Generally just making a JAR a bundle is not enough to make sure it runs
fine in OSGi. All dynamic class loading has to be analyzed.

I identified the following places where XNIO does dynamic class loading
and believe they are all addressed as I have the XNIO hello world echo
server running in Equinox.

1. `Xnio` uses `ServiceLoader` to dynamically load the implementation
class. This can be addressed by making xnio-nio a fragment of
xnio-api.
1. `org.xnio.sasl.SaslUtils#getFactories` already uses the correct
class loader
1. `org.xnio.Option#fromString` no option classes outside of xnio-api
seem to be used so this should work
1. `org.xnio.Option#getClassParser` see above
1. `NioXnio` tries to load `java.nio.channels.MulticastChannel` this is
fine because it's a `java` package which is always available
1. `NioXnio` tries to load `sun.nio.ch.PollSelectorImpl` this is an
issue as `sun` packages are generally not available. This can be
solved by setting the `org.osgi.framework.system.packages.extra`
system property to `sun.nio.ch`

Changes in this pull request:

- make xnio-api a bundle
- make xnio-nio a fragment of xnio-api

Issue: XNIO-195
https://issues.jboss.org/browse/XNIO-195