blob: 10ddbc3970ac0049332aa3cf2a4d8153848231f9 [file] [log] [blame]
<meta name="copyright" content="Copyright Technical University Berlin and others 2004, 2010. This page is made available under the Eclipse Public License v1.0. For full details see" />
<link rel=stylesheet type="text/css" href="../css/book.css">
<link rel=stylesheet type="text/css" href="otguide.css">
<title>Running Object Teams programs</title>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<h1>Running Object Teams programs</h1>
Technically running an Object Teams program involves a special runtime enviroment
(the <strong>OTRE - Object Teams Runtime Environment</strong>) which provides fundamental classes
and performs load-time weaving for connecting aspects with their bases.
All this is hidden as to make running Object Teams programs as easy as running Java programs.
<p style="margin-left:20px;margin-right:40px;font-style:italic;">
Previous versions of the OTDT introduced specific launch types (<img src="../images/otj_launch.gif" valign="absmiddle"> Object Teams Application, <img src="../images/ote_launch.gif" valign="absmiddle"> Object Teams Eclipse Application <img src="../images/ote_osgi_launch.gif" valign="absmiddle"> OT/Equinox Framework) which are no longer supported.
For launching OT/J programs use any of the launching techniques offered by Eclipse:
You may, e.g., invoke a <span class="ui">Run As</span>/<span class="ui">Debug As</span> option
from a context menu or use one of the run/debug tool bar buttons.
From here just select one of the standard launch configuration types:
<li><a href="#JavaApp"><img src="images/java_app.gif" valing="absmiddle"> Java Application</a></li>
<li><a href="#RemoteJavaApp"><img src="images/java_attach.gif" valing="absmiddle"> Remote Java Application</a></li>
<li><a href="#JavaApp"><img src="images/julaunch.gif" valing="absmiddle"> JUnit</a></li>
<li><a href="#Plugin"><img src="images/julaunchpgn.gif" valing="absmiddle"> JUnit Plug-in Test</a></li>
<li><a href="#Plugin"><img src="images/eclipse_launcher.gif" valing="absmiddle"> Eclipse Application</a></li>
<li><a href="#OSGi"><img src="images/bundle_obj.gif" valing="absmiddle"> OSGi Framework</a></li>
All these launches now consistently provide one additional checkbox, which is shown next to where the Runtime JRE is configured.
<p style="margin-top:30px;"><a name="JavaApp"/>
For <strong>Java Applications</strong> (<img src="images/java_app.gif" valing="absmiddle">, <img src="images/julaunch.gif" valing="absmiddle">) this checkbox is found on the <img src="images/library_obj.gif"><code>JRE</code> tab:
<p><img src="images/screenshots/JRETab.png"></p>
<li style="margin-bottom:7px;">If the new option is checked the application will be launched with the Object Teams Runtime Environment (OTRE) enabled which is needed to weave callin bindings into base classes. Conversely, disabling the OTRE lets you run an OT/J application with all callin-bindings disabled. But note that a few more OT/J mechanisms will not work either (like decapsulation).</li>
<li style="margin-bottom:7px;">For OT/J projects this option is enabled by default.</li>
<li style="margin-bottom:7px;">If <span class="ui">Enable OTRE</span> is checked an additional <a href="#activation"><img valing="absmiddle" src="../images/team_obj.gif"><code>Team Activation</code> tab</a> will be shown.<br>
<i>(If a launch configuration was opened while the OTRE was disabled, you need to re-open this configuration (e.g., unselect and select) in order for the new tab to show.)</i></li>
<p style="margin-top:30px;"><a name="RemoteJavaApp"/>
For <strong>Remote Debugging</strong> of a java applications</strong> (<img src="images/java_attach.gif" valing="absmiddle">) this checkbox is found on the <img src="images/disconnect_co.gif"><code>Connect</code> tab:
<p><img alt="Remote Debugging" src="images/screenshots/RemoteDebugging.png" /></p>
<p style="margin-top:30px;"><a name="Plugin">
For launching a <strong>Runtime Workbench</strong> (<img src="images/julaunchpgn.gif" valing="absmiddle">, <img src="images/eclipse_launcher.gif" valing="absmiddle">) the new checkbox is right on the main page:
<p><img src="images/screenshots/RuntimeWorkbenchMainTab.png">
<p style="margin-top:30px;"><a name="OSGi">
For <strong>OSGi Framework</strong> launches (<img src="images/bundle_obj.gif" valing="absmiddle">) the runtime environment is configured on the <code>Settings</code> tab:
<p><img src="images/screenshots/OSGiLaunchSettings.png"></p></td></tr>
<h2><a name="activation">Team activation:</a></h2>
I you wish to compose your program from a base application and a number of aspects,
you may use a launch configuration to select which aspects should be included.
Use the tab <b><img src="../images/team_obj.gif">Team Activation</b>
to select existing teams and put them into the desired order.
The effect is that each team in the list will be instantiated and activated before
the main method of the program executes. This can actually be observed if <span class="ui">Stop in main</span>
is checked for debugging: the program will actually stop <i>before</i> entering main, the next step
will perform all pending team instantiations/activations and only then the program starts
(You might want to use the <a href="teammonitor.html">team monitor</a> to observe
team instantiation/activation).
<p>Since a team can intercept method calls in a base application simply adding a team to
an existing application can indeed produce different behavior.