J2EE - Class Redefinition (FastSwap)

> Procedural Languages > Java

1 - About

Java EE 5 introduces the ability to redefine a class at runtime without:

  • dropping its ClassLoader
  • or abandoning existing instances.

This allows containers to reload altered classes without disturbing running applications, vastly speeding up iterative development cycles and improving the overall development and testing experiences.

The usefulness of the Java EE dynamic class redefinition is severely curtailed, however, by the restriction that the shape of the class – its declared fields and methods – cannot change.

3 - FastSwap

FastSwap remove the redefinition restriction in Weblogic, allowing the dynamic redefinition of classes with new shapes to facilitate iterative development. With FastSwap, Java classes are redefined in-place without reloading the ClassLoader.

You can

  • make your changes,
  • auto compile,
  • and then see the effects immediately.

To enable FastSwap in your application, add the following element to the weblogic-application.xml file.

<fast-swap>true</fast-swap> 
Advertising

4 - Documentation / Reference

lang/java/redefinition.txt · Last modified: 2017/02/12 21:05 by gerardnico