I’m playing around with the Felix OSGi container to create some basic OSGi support for NetBeans. It should allow you to start and stop Felix and add a project Type to create OSGi bundles. There’s a Options Panel to let you set the felix install dir and use it from there. To use this as a property in Ant build skripts I need to set it globally. That’s easy with the Global Properties:
try {
EditableProperties ep = PropertyUtils.getGlobalProperties();
ep.setProperty(”felix.install.dir”, dir);
PropertyUtils.putGlobalProperties(ep);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
Now all build scripts can access this property…
Update: Here’s an example
<project name="de.eppleton.modules.felix" default="netbeans" basedir=".">
<description>Builds, tests, and runs the project de.eppleton.modules.felix.</description>
<import file="nbproject/build-impl.xml"/>
<target name="run-felix">
<echo message="${felix.install.dir}"/>
<java classname="org.apache.felix.main.Main">
<sysproperty key="org.osgi.service.http.port" value="1234"/>
<classpath>
<pathelement location="${felix.install.dir}/bin/felix.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
</target>
</project>
Strange, reading the news today I started hearing Kent Brockman’s voice in my head:
“Ladies and gentlemen, er, we’ve just lost the picture, but, uh, what we’ve seen speaks for itself. The Corvair spacecraft has been taken over — ‘conquered’, if you will — by a master race of giant space ants. It’s difficult to tell from this vantage point whether they will consume the captive earth men or merely enslave them. One thing is for certain, there is no stopping them; the ants will soon be here. And I, for one, welcome our new insect overlords. I’d like to remind them that as a trusted TV personality, I can be helpful in rounding up others to…toil in their underground sugar caves.”
When you clone NetBeans mercurial repositories, you’ll find a folder named “contrib” in the sources. If you’re developing RCP applcations it pays to have a look into that folder. There are a lot of projects by other developers that might turn out useful for your own development. Many features you might be missing from the platform live in there as netbeans projects and you can add them to your applications instead of having to implement them yourself. Here are some of my favorites:
- perspective plugin: Define sets of windows as Perspectives ( similar to Eclipse perspectives ) in the layer and manage them via ui elements or programatically via the PerspectiveManager. The API fits seamlessly into the WindowSystem API and is extremely easy to use…
- zeroadmin & remotesfs: Have your user directory on the server for JNLP apps. Wherever your user logs in settings will be restored from the remote system filesystem. Contains a server implementation and the client module.
- a11y: Check forms for accessibility, the moduel also adds quickfixes for the problems identified.
Right now I’m checking out “JNLP Modules”, a module that brings back module isolation to RCP apps launched via Java Webstart.
What’s your favorite contribution?
I’ve just returned from a very interesting job in England and found a file copy of my latest article on NB 6.5 in my mail basket. It’s a very nice issue that also contains the start of a new series on Scala. Great also to see NB Dream Team member Adam Bien’s picture on the title page. There’s a recording of his W-JAX Session on Java SE 6u10, JavaFX SDK, Applets 2.0 on the magazine CD. There will be some more articles on NB soon in JavaSpektrum, another german magazine, also about the platform…
Sad to hear Lukas Hasik is leaving NetBeans after 8 years, but as Fabrizio pointed out in the comments it’s good that “it’s a deliberate move and not a layoff”.
Good luck with your new Job and thanks for the great job you’ve been doing for NetBeans and the community. We’ll miss you!