OTDT 2.5 - New and Noteworthy

Object Teams Runtime Environment

New byte code weaver
 
462605
480068

The new byte code weaver, initially released with OTDT 2.3, has matured to the point where it is considered production-ready in 2.5.

This weaver, called "Object Teams Dynamic Runtime Environment (OTDRE)", has two advantages over the traditional OTRE:

  • It supports runtime weaving, i.e., the option to weave and activate roles and teams that are not known during application launch.
  • It is fully capable of handling Java 8 byte code. This is a side-effect of using the byte code library ASM (as opposed to the BCEL-based implementation of OTRE).

Maturity of the new weaver is witnessed by the fact that OTDT 2.5 in fact runs on this new runtime.

Both weavers are supported by the compiler by generating specific infrastructure to be invoked from woven code. Due to the fundamental difference in weaving schemes, it is necessary to selected at compile time, which weaver should be targeted. Please see the section on target weaving schemes in the developers' guide.

Tuning the weaver
 
493556

When per-thread activation of teams (§5.1.1) is used, the runtime needs to be notified when new threads are started. This happens by weaving into sub classes of Thread and Runnable, which may incur some performance penalty. For optimization in applications where this notification is not needed, such weaving can now be tuned / disabled using the system property otequinox.weave.thread with one of the following values:

"false"
Completely disable weaving into subtypes of Thread and Runnable.
"base"
Weave only into those subtypes of Thread and Runnable that reside in a plug-in that is also affected by an aspectBinding (OT/Equinox only).
any other value (including unset)
Enable normal weaving into subtypes of Thread and Runnable.

Define weavable regions
since 2.5M3
480760

Under OTDRE, every class in the system should be seen as the potential base class of some role to be loaded at runtime. It may be desirable to restrict this to specified "weavable code regions". Possible reasons include performance and protection (of sensitive code regions, e.g.).

It is now possible to define such "weavable code regions" by providing a simple text file. Each line in this file will be interpreted as a prefix of class names (no support for wildcards at this point). A class whose fully qualified name matches one of these prefixes is weavable, all others cannot be woven into.

The text file is announced to the runtime by providing its path in the file system as the value to the system property ot.weavable.

Compiler

Preference UI for weaving scheme
since 2.5M3
481065

New UI is provided for selecting the weaving scheme:

Selecting the weaving scheme to compile for

OT/Equinox

Use OTDRE by default
since 2.5M3
480068

When installing OT/Equinox (i.e., the plug-in org.eclipse.objectteams.otequinox), the new weaver OTDRE is by default selected in eclipse.ini.

Run / Debug

Auto-select weaver
since 2.5M7
462785

When launching an OT/Equinox-enabled application, the correct weaving scheme is now automatically selected by inspecting any OT/J projects involved in the launch. It is not necessary to explicitly pass any Object Teams specific arguments.

For plain OT/J applications this was solved already in OTDT 2.3.