Equinox Aspects 1.0 M1 - New and Noteworthy

The Equinox Aspects incubator project is now aligning itself with the general development process of the other Eclipse projects and is moving towards graduation. Therefore we are starting this effort by producing a number of milestone builds over the next weeks and months and share them with you - including a new and noteworthy announcement.


General


Bundle renaming To be a better citizan of the Eclipse community the Equinox Aspects bundles were renamed to fit into the naming conventions of the Equinox project.
  • org.aspectj.osgi -> org.eclipse.equinox.weaving.hook
  • org.aspectj.osgi.service.weaving -> org.eclipse.equinox.weaving.aspectj
  • org.aspectj.osgi.service.caching -> org.eclipse.equinox.weaving.caching
  • org.aspectj.osgi.service.caching.j9 -> org.eclipse.equinox.weaving.caching.j9
If you have used Equinox Aspects before this bundle renaming you just need to update your config.ini or launch configuration. Define org.eclipse.equinox.weaving.hook as your framework extension and start the new weaving and caching serivces instead of the old ones.

New wiki-based planning Equinox Aspects now has a transparent project planning via the Equinox Aspects Wiki Plan. You can see what we have planed for the next milestones and what the state of the current development work is.

Weaving


OSGi dynamics for aspect bundles OSGi allows you to install, update or uninstall bundles at runtime. The same is now possible for bundles that provide aspects to be woven into the system and for bundles that need to be woven or that are already woven by aspects from other bundles.
The effect of installing an aspect bundle at runtime is:
  1. Read the supplement-headers from the aspect bundle
  2. Update existing bundles that would be supplemented by the new aspect bundle
  3. As a result of the bundle update those bundles are supplemented and woven from now on
A similar mechanism deals with bundle updates and uninstalls. In the end this means that you have no limitations with regards to dynamics. You get somewhat a feeling of runtime weaving.

The only prerequisite is that all other bundles need to be dynamic-aware and dynamic-enabled so that bundle updates are handling correctly by those bundles.


OSGi dynamics for weaving services We spend some time to improve the dynamics of the weaving service itself. This means that you are now able to start and stop the weaving service itself at runtime.

As a result of stopping the weaving service all woven bundles are updated to remove the aspects being woven from those bundles. If you start the weaving service, the updating and therefore re-weaving of already existing bundles takes place as well.


Easier aop.xml lookup In the past the lookup of the aop.xml definition files was similar to the load-time weaving aop.xml lookup that AspectJ uses. Equinox Aspects moved away from this kind of configuration (via org.aspectj.weaver.loadtime.configuration). Instead you can now just put the aop.xml file into the META-INF directory and Equinox Aspects finds it automatically without any configuration.
If you would like to put the aop.xml file into a different directory you have to define this location in the MANIFEST.MF via a special header:

Eclipse-AspectContext: META-INF/aspects/aop.xml

You can do this on a per-bundle base.


Caching


Caching now aware of versions The caches for woven bytecodes are now aware of bundle versions. The version information is used to identify woven bundles as well as aspect bundles.

Therefore the cache is invalidated if the version of a bundle that provides an aspect has changed. The cache is invalidated for the aspect bundle as well as all bundles where this aspect was woven into. If a non-aspect bundle changes its version, the cache is invalidated for this bundle only.

In fact the cache is not flushed but changed to a different partition. This means that the cache works fine if you switch, for example, between different bundle sets.


Standard caching performance improvements We worked a lot on the performance of the standard caching service. It now works a lot faster. The improvements include:
  • Caching works for bundles which are not woven without writing unchanged bytecode to the cache. The cache controls that unwoven bundles are not passed to the weaver anymore
  • The lookup performance for cached bytecodes improved drastically
Starting the system from cache is now at a similar speed as starting the system without equinox aspects.

Documentation


New "Hello world!" demo The "Hello world!" demo has been updated to the latest Equinox Aspects target. In particular the new bundle naming is considered.