Latest news

JavaRebel 1.2.1 and Spring Plugin 1.0-M2 Released

We are very proud to present not one, but two simultaneous releases....

JavaRebel used to develop LinkedIn

LinkedIn, Corp. has purchased JavaRebel licenses for all its Java engineers to use in the well-known social networking website dev...

JavaRebel 1.2: Now With Full Spring Support

The latest stable release of the JavaRebel code reloading agent includes a plugin for Spring that reloads Spring configuration on-...

Archive for June, 2008

Screencast: Developing Swing with JavaRebel

Thursday, June 12th, 2008
We prepared a short screencast that demonstrates how easy it is to develop Swing applications with JavaRebel. We used the simple Metalworks example (a multiwindow mail client mockup) that comes with the Java SDK and played around with adding fields and buttons.

We start by launching the application with “-noverify -javaagent:javarebel.jar” added to the VM params in the Eclipse launch profile. We first add new field “BCC”, which immediately appears in a new window. We then also add a Send button, which first does nothing. We then proceed to add a listener that points to the new send() method. After we make the body of the method to show a message box it is visible in both new and old windows that had a listener added. Finally we refactor the class adding a field and showing its value in the message box. Note that old instances have the field, but it’s initialized to null, while the new instance works properly.

Since most of the Swing initialization will happen only once, a nice trick we found for making a component reinit itself is using the JavaRebel SDK as follows:

JAVA:
  1. ReloaderFactory.getInstance().addClassReloadListener(
  2.     new ClassEventListener() {
  3.   public void onClassEvent(int eventType, Class klass) {
  4.     if (MyClass.class == klass) {
  5.       java.awt.EventQueue.invokeLater(new Runnable() {
  6.         public void run() {
  7.           reinit();
  8.         }
  9.       });
  10.     }
  11.   }
  12. });

JavaRebel 1.2-M1 Released

Monday, June 9th, 2008

The first release of the new development branch focuses mainly on ease of integrating JavaRebel with third-party frameworks and containers. The following main changes can be found in the 1.2 branch:

  • JavaRebel SDK. The SDK has been refactored with added functionality for processing class bytecode and managing JavaRebel configuration.
  • JavaRebel Plugins. It is now possible to register JavaRebel plugins that can make use of the SDK APIs to integrate with custom containers or frameworks. A howto on creating plugins is also available
  • JavaRebel Integration Project. To test the new SDK APIs and plugins we created the open-sourced Integration project and moved almost all of the custom container/framework integration processors there. This was done partially to simplify the integration process for us and partially to provide an example for creating your own integration plugins. The Integration project is bundled (including source) with JavaRebel, so you can depend on it to create your own plugins. A renamed version of Javassist (to avoid version conflicts) is also included in the Integration project.
  • Package filtering. JavaRebel now allows filtering the instrumented packages using the system properties “-Drebel.packages”, “-Drebel.packages_include”, “-Drebel.packages_exclude” described in the configuration manual included with the distribution.

Using the new APIs and the Integration project we have added full support for Eclipse plugins (and OSGi bundles generally) and initial support for IBM WebSphere. We have also integrated with Commons-EL, to update metadata whenever classes change.

As you can see we put a lot of effort into making third-party frameworks as easy to integrate with as possible. Although we will continue to add support for more of the popular frameworks you are also welcome to contribute to the Integration project or write your own plugin. All open-source projects (including SDK and Integration) are hosted at the zt-oss Google Code project and the discussion list for this is ZeroTurnaround Community.