
As Geir notes, Harmony now has two decent VMs to choose from. Anyone planning to hack Hotspot to run with Harmony?
package org.foo.example; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; public class Example implements BundleActivator { public void start(BundleContext bc) { System.out.println("Hello world"); } public void stop(BundleContext bc) { System.out.println("Goodbye world"); } }
> javac -cp org.eclipse.osgi_3.2.1.R32x_v20060919.jar org/foo/example/Example.java
Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.example.Example Bundle-Version: 1 Bundle-Activator: org.foo.example.Example Import-Package: org.osgi.framework;version="1.3.0"Make sure you have a carriage return and/or newline character at the end of the last line as this is required (see manifest specification in the JAR specification).
> jar cvfm example.jar MANIFEST.MF org
> java -jar org.eclipse.osgi_3.2.1.R32x_v20060919.jar -console osgi> install file:///osgi/blog/example/example.jar Bundle id is 6 osgi> start 6 Hello world osgi> stop 6 Goodbye world osgi> close
What weirds me out about OSGi is the licensing of the real specs:His fears should be addressed, at least for OSGi R4, by OSGi's non-assert agreements which provide royalty free access to patents for implementers of OSGi. Implementations, in this sense, do not need to pass the TCK, although they must be "intended to accurately implement the normative portions of [the OSGi R4] specification (subject to normal, inadvertent programming errors)" and must not "intentionally introduce incompatibilities that hinder interoperability".
"You are not authorized to create any derivative work of the Specification. The OSGi Alliance also grants you a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, limited license (without the right to sublicense) under any applicable copyrights, to create and/or distribute an implementation of the Specification that: (i) fully implements the Specification including all its required interfaces and functionality; (ii) does not modify, subset, superset or otherwise extend the OSGi Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the OSGi Name Space other than those required and authorized by the Specification. An implementation that does not satisfy limitations (i)-(ii) is not considered an implementation of the Specification, does not receive the benefits of this license, and must not be described as an implementation of the Specification. An implementation of the Specification must not claim to be a compliant implementation of the Specification unless it passes the OSGi Alliance Compliance Tests for the Specification in accordance with OSGi Alliance processes."
The silly talk about subsetting in that license makes Equinox, Felix and all the other OSGi implementations developed open to patent attacks from OSGi patent holders, since they are naturally going to be subsets until they implement whatever the current full specification is.
Are those compliance tests freely available somewhere, so that re-distributors can limit their liability to being attacked via software patents on OSGi, by checking which implementations actually conform to the tests?