blob: e98b006e59a0e5c563a063dc5746a2745afa7767 [file] [log] [blame]
<html>
<head>
<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 http://www.eclipse.org/legal/epl-v10.html" />
<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">
</head>
<body>
<h1>Running Object Teams programs</h1>
<p>
Technically running an Object Teams program involves a special runtime environment
(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.
Only when targeting Java 8, selection of the appropriate <strong><a href="weavingscheme.html">target weaving scheme</a></strong> is necessary.
</p>
<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.
</p>
<p>
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:
<ul>
<li><a href="#JavaApp"><img src="images/java_app.gif" valign="absmiddle"> Java Application</a></li>
<li><a href="#RemoteJavaApp"><img src="images/java_attach.gif" valign="absmiddle"> Remote Java Application</a></li>
<li><a href="#JavaApp"><img src="images/julaunch.gif" valign="absmiddle"> JUnit</a></li>
<li><a href="#Plugin"><img src="images/julaunchpgn.gif" valign="absmiddle"> JUnit Plug-in Test</a></li>
<li><a href="#Plugin"><img src="images/eclipse_launcher.gif" valign="absmiddle"> Eclipse Application</a></li>
<li><a href="#OSGi"><img src="images/bundle_obj.gif" valign="absmiddle"> OSGi Framework</a></li>
</ul>
<p>
All these launches now consistently provide one additional checkbox, which is shown next to where the Runtime JRE is configured.
</p>
<p style="margin-top:30px;" id="JavaApp">
For <strong>Java Applications</strong> (<img src="images/java_app.gif" valign="absmiddle">, <img src="images/julaunch.gif" valign="absmiddle">) this checkbox is found on the <img src="images/library_obj.gif"><code>JRE</code> tab:
</p>
<p><img src="images/screenshots/JRETab.png"></p>
<ul>
<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 valign="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>
<li style="margin-bottom:7px;">Behind the scenes, when <span class="ui">Enable OTRE</span> is checked, the correct <a href="weavingscheme.html">weaving scheme</a> is selected based on the configuration of projects involved in the launch.</li>
</ul>
<p style="margin-top:30px;" id="RemoteJavaApp">
For <strong>Remote Debugging</strong> of a <strong>java applications</strong> (<img src="images/java_attach.gif" valign="absmiddle">) this checkbox is found on the <img src="images/disconnect_co.gif"><code>Connect</code> tab:
</p>
<p><img alt="Remote Debugging" src="images/screenshots/RemoteDebugging.png" /></p>
<p style="margin-top:30px;" id="Plugin">
For launching a <strong>Runtime Workbench</strong> (<img src="images/julaunchpgn.gif" valign="absmiddle">, <img src="images/eclipse_launcher.gif" valign="absmiddle">) the new checkbox is right on the main page:
</p>
<p><img src="images/screenshots/RuntimeWorkbenchMainTab.png">
</p>
<p style="margin-top:30px;" id="OSGi">
For <strong>OSGi Framework</strong> launches (<img src="images/bundle_obj.gif" valign="absmiddle">) the runtime environment is configured on the <code>Settings</code> tab:
</p>
<p><img src="images/screenshots/OSGiLaunchSettings.png"></p>
<h2 id="activation">Team activation:</h2>
<p>
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.
</p><p>
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>
<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.
</p>
</body>
</html>