Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "OTJ"

(New page: {{note|The programming language OT/J implements the programming model Object Teams for the host language Java.}} 500px = OT/J Language Definition (OTJLD) = This i...)
 
Line 24: Line 24:
 
:'''Compatibility'''
 
:'''Compatibility'''
 
:OT/J is compiled by a modified version of the Eclipse compiler for Java. This means that the OT/J compiler can also compile any Java program. While OT/J introduces some new keywords most of these words are still treated as normal identifiers ''until'' the keyword '''<code>team</code>''' has been parsed ({{otjld|A|.0.1}} -- ''"scoped keywords"''). This provides the greatest possible compatibility at the syntax level.
 
:OT/J is compiled by a modified version of the Eclipse compiler for Java. This means that the OT/J compiler can also compile any Java program. While OT/J introduces some new keywords most of these words are still treated as normal identifiers ''until'' the keyword '''<code>team</code>''' has been parsed ({{otjld|A|.0.1}} -- ''"scoped keywords"''). This provides the greatest possible compatibility at the syntax level.
 +
 
:'''Compiler invocation'''
 
:'''Compiler invocation'''
 
:The compiler can be invoked either from the ObjectTeamsDevelopmentTooling (OTDT) or as a [http://www.objectteams.org/distrib#commandlinecompiler command line compiler]. For compiling OT/J source outside Eclipse please see [[OT/Compiling With Ant|Compiling With Ant]].
 
:The compiler can be invoked either from the ObjectTeamsDevelopmentTooling (OTDT) or as a [http://www.objectteams.org/distrib#commandlinecompiler command line compiler]. For compiling OT/J source outside Eclipse please see [[OT/Compiling With Ant|Compiling With Ant]].
 +
 
:'''Compiler output'''
 
:'''Compiler output'''
 
:The compiler produces '''regular Java <code>.class</code> files''', which are enriched with OT/J specific meta data using Java bytecode attributes. These meta data are interpreted by the OTRE (see below) in order to weave <code>playedBy</code> and <code>callin</code> bindings into base classes. This implies that OT/J programs need to be launched with the OTRE enabled. Other than that any recent JVM (&ge;1.5) can be used.
 
:The compiler produces '''regular Java <code>.class</code> files''', which are enriched with OT/J specific meta data using Java bytecode attributes. These meta data are interpreted by the OTRE (see below) in order to weave <code>playedBy</code> and <code>callin</code> bindings into base classes. This implies that OT/J programs need to be launched with the OTRE enabled. Other than that any recent JVM (&ge;1.5) can be used.
Line 40: Line 42:
  
 
==='''Weaving into system classes===
 
==='''Weaving into system classes===
:In contrast to an earlier architecture in JPLIS mode the OTRE can weave into more classes, i.e., even system classes from Java's <code>rt.jar</code> can potentially be bound as base classes ''(note, that any classes loaded ''before'' the OTRE starts operation can  
+
:In contrast to an earlier architecture in JPLIS mode the OTRE can weave into more classes, i.e., even system classes from Java's <code>rt.jar</code> can potentially be bound as base classes ''(note, that any classes loaded ''before'' the OTRE starts operation can still not be woven).''
still not be woven).''
+
  
 
==='''Launching from the command line'''===
 
==='''Launching from the command line'''===

Revision as of 14:36, 26 February 2010

Note.png
The programming language OT/J implements the programming model Object Teams for the host language Java.
Otj.png


OT/J Language Definition (OTJLD)

This is the definitive point of reference for OT/J

http://www.objectteams.org/publications/OTJLDv1.2.pdf

First Reading

Implementation

Compiler

Compatibility
OT/J is compiled by a modified version of the Eclipse compiler for Java. This means that the OT/J compiler can also compile any Java program. While OT/J introduces some new keywords most of these words are still treated as normal identifiers until the keyword team has been parsed (OTJLD §A.0.1 -- "scoped keywords"). This provides the greatest possible compatibility at the syntax level.
Compiler invocation
The compiler can be invoked either from the ObjectTeamsDevelopmentTooling (OTDT) or as a command line compiler. For compiling OT/J source outside Eclipse please see Compiling With Ant.
Compiler output
The compiler produces regular Java .class files, which are enriched with OT/J specific meta data using Java bytecode attributes. These meta data are interpreted by the OTRE (see below) in order to weave playedBy and callin bindings into base classes. This implies that OT/J programs need to be launched with the OTRE enabled. Other than that any recent JVM (≥1.5) can be used.

Object Teams Runtime Environment (OTRE)

As mentioned, running an OT/J application requires the OTRE. Currently two alternative modes are supported how the OTRE can be linked into an OT/J application:

  • JPLIS:
This technology is part of the Java standard since version 1.5. Launching an application in JPLIS mode only requires a few items added to the classpath and an -javaagent:... argument, which means a non-invasive way of launching OT/J programs like plain Java programs.
By integration of OT/J with the Equinox component framework, also Eclipse plug-ins (RCP, OSGi bundles) can leverage OT/J. In this case running OT/J code only requires to have the OT/Equinox feature installed on top of Equinox.

Within the OTDT the OTRE is enabled by a new checkbox adjacent to the JRE configuration ([1]).

Weaving into system classes

In contrast to an earlier architecture in JPLIS mode the OTRE can weave into more classes, i.e., even system classes from Java's rt.jar can potentially be bound as base classes (note, that any classes loaded before the OTRE starts operation can still not be woven).

Launching from the command line

For running OT/J applications outside Eclipse please see Running OT/J Standalone.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.