| <?xml version="1.0" encoding="UTF-8" ?> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta name="copyright" content="Copyright (c) 2007, 2019 EclipseSource. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page."/> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| <title>Choosing a RAP Application Setup</title> |
| <link rel="stylesheet" href="../../../PRODUCT_PLUGIN/book.css" type="text/css"/> |
| </head> |
| <body> |
| |
| <h1>Choosing an Application Setup</h1> |
| <p> |
| RAP can be combined with various other technologies and deployed in different setups. |
| Your choice of an application setup depends on the technologies you want to use and the |
| server you need to deploy the application on. |
| </p> |
| |
| <h2 id="osgi">OSGi or stand-alone?</h2> |
| <p> |
| OSGi is a module platform for Java that allows you to organize your application in loosely |
| coupled modules, called bundles, that communicate over a service infrastructure. |
| Eclipse is based on OSGi and provides a lot of bundles that you can re-use in your application. |
| RAP is designed to work with any standard-compliant OSGi implementation. |
| It is often used on Equinox, the OSGi reference implementation by Eclipse, but can also |
| run on other OSGi containers like Apache Felix. |
| </p> |
| <p> |
| If you don't need or don't like to use OSGi in your web application, you can still use RWT as a |
| normal Java library. This setup is usually referred to as |
| <em><a href="rwt-standalone.html">RWT standalone</a></em>. |
| </p> |
| |
| <h2>Direct or WAR-Deployment?</h2> |
| <p> |
| OSGi-based applications can be deployed in basically two different ways. |
| </p> |
| <ul> |
| <li> |
| The application bundles can be deployed directly in an OSGi container such as Equinox or Felix. |
| In this case, a servlet engine bundle must be running in the same OSGi instance. |
| The Jetty servlet engine is available as OSGi bundles and is a good choice for this setup. |
| </li> |
| <li> |
| It is also possible to deploy an OSGi-based application to a servlet container. |
| To do so, an Equinox OSGi instance including the application bundles is wrapped |
| in a web archive (.war file) using the Equinox servlet bridge. |
| This approach is explained in the <a href="deployment.html">WAR deployment guide</a>. |
| </li> |
| </ul> |
| <p> |
| When using RWT stand-alone, the RWT servlet is |
| <a href="rwt-standalone.html#deploy">configured directly</a> in the application's web.xml file. |
| </p> |
| |
| <h2 id="compat">JEE or SWT compatibility?</h2> |
| <p> |
| RWT has two different modes of operation, which can be configured in the |
| <a href="application-configuration.html">application configuration</a>. |
| The default one is <strong>fully compatible with JEE</strong>, lightweight, and supports transparent |
| session failover in |
| <a href="http://wiki.eclipse.org/RAP/RWT_Cluster">clustering environments</a> |
| (clustering currently requires an RWT standalone setup). |
| This is the recommended operation mode in most cases. |
| </p> |
| <p> |
| As an alternative, the <strong>SWT compatibility mode</strong> exactly emulates the SWT threading model. |
| To make this possible, a separate UI thread has to be started for every user session. |
| As a consequence, the code running in the UI thread cannot directly access JEE transaction |
| or security contexts. |
| </p> |
| <p> |
| The SWT compatibility mode is only required for code that uses SWT's few blocking APIs. |
| The most obvious case are blocking dialogs (i.e. calling <code>dialog.open()</code> will suspend code |
| execution until the dialog is closed by the user, and then return a value). |
| In JEE mode, code execution will continue after opening the dialog, but any operations reacting |
| to closing the dialog must be done in a callback. |
| RAP provides an |
| <a href="../reference/api/org/eclipse/swt/widgets/Dialog.html#open-org.eclipse.rap.rwt.widgets.DialogCallback-">additional API</a> |
| that can be used for those dialog callbacks. |
| This mechanism does not exist in SWT. |
| </p> |
| <p> |
| Another blocking API in SWT are the <em>Browser</em>-widget's execute and evaluate |
| methods. Their return value can also be obtained |
| <a href="../reference/api/org/eclipse/swt/browser/Browser.html#evaluate-java.lang.String-org.eclipse.rap.rwt.widgets.BrowserCallback-">using callback API</a>, |
| but this may be problematic when developing |
| <a href="custom-widget.html#browser">browser-based custom widgets</a>. |
| </p> |
| |
| <h2 id="workbench">Eclipse Workbench (RCP)</h2> |
| <p> |
| If you're building an application based on the Eclipse workbench, you need a platform that |
| includes the Equinox OSGi implementation and the extension registry. |
| Moreover, these applications require the SWT compatibility mode. |
| </p> |
| |
| <h3>Eclipse 3.x</h3> |
| <p> |
| The application and all contributions, such as views or themes, must be |
| <a href="branding.html">registered as extensions</a>. |
| </p> |
| |
| <h3>Eclipse 4.x</h3> |
| <p> |
| Eclipse 4.x applications can run on RAP using the E4 support in the |
| <a href="http://www.eclipse.org/rap/incubator/">RAP Incubator</a>. |
| For details, see the |
| <a href="http://wiki.eclipse.org/RAP/Eclipse4">RAP E4 wiki page</a>. |
| </p> |
| |
| <h2 id="summary">Summary</h2> |
| <p> |
| Here is a comparison of 3 typical RAP-setups: |
| </p> |
| <table width="100%" border="1" cellpadding="3" cellspacing="0"> |
| <tr> |
| <th align="left" width="10%"></th> |
| <th align="left" width="30%">RAP with OSGi</th> |
| <th align="left" width="30%">RAP with Workbench</th> |
| <th align="left" width="30%">RWT Standalone</th> |
| </tr> |
| <tr> |
| <th align="left">Summary</th> |
| <td>Lightweight and flexible, recommended for new applications that do not use Eclipse extensions</td> |
| <td>For applications using the Eclipse Workbench (RCP applications)</td> |
| <td>No OSGi, RWT used as a library in a traditional web app</td> |
| </tr> |
| <tr> |
| <th align="left">OSGi</th> |
| <td>Compatible with any OSGi implementation including Equinox</td> |
| <td>Eclipse Equinox required</td> |
| <td>No OSGi</td> |
| </tr> |
| <tr> |
| <th align="left">Deployment</th> |
| <td> |
| As WAR file in servlet container or directly in OSGi container with embedded server. |
| Direct access to JEE contexts possible with JEE compatibility mode. |
| </td> |
| <td> |
| As WAR file in servlet container or directly in OSGi container with embedded server. |
| </td> |
| <td> |
| As WAR file in servlet container. |
| Direct access to JEE contexts possible with JEE compatibility mode. |
| Clustering supported. |
| </td> |
| </tr> |
| <tr> |
| <th align="left">Configuration</th> |
| <td> |
| Using the <a href="application-configuration.html">Application Configuration</a> API |
| </td> |
| <td> |
| Using extension points <a href="branding.html">Branding</a> |
| </td> |
| <td> |
| Using the <a href="application-configuration.html">Application Configuration</a> API |
| <a href="rwt-standalone.html#deploy">RWT servlet and application configured in web.xml.</a> |
| </td> |
| </tr> |
| <tr> |
| <th align="left">Entry-point</th> |
| <td><em><a href="../reference/api/org/eclipse/rap/rwt/application/EntryPoint.html">EntryPoint</a></em></td> |
| <td><em><a href="../reference/api/org/eclipse/rap/rwt/application/EntryPoint.html">EntryPoint</a></em> or <em><a href="/help/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/equinox/app/IApplication.html">IApplication</a></em></td> |
| <td><em><a href="../reference/api/org/eclipse/rap/rwt/application/EntryPoint.html">EntryPoint</a></em></td> |
| </tr> |
| <tr> |
| <th align="left">Operation Modes</th> |
| <td>SWT or JEE compatibility mode</td> |
| <td>SWT compatibility mode enforced</td> |
| <td>SWT or JEE compatibility mode</td> |
| </tr> |
| <tr> |
| <th align="left">RCP Compatibility</th> |
| <td>SWT, JFace</td> |
| <td>SWT, JFace, Workbench</td> |
| <td>SWT, JFace</td> |
| </tr> |
| <tr> |
| <th align="left">Launch from IDE</th> |
| <td><a href="launcher.html#rap-launcher">RAP Launcher</a></td> |
| <td><a href="launcher.html#rap-launcher">RAP Launcher</a></td> |
| <td><a href="launcher.html#rwt-launcher">RWT Launcher</a></td> |
| </tr> |
| </table> |
| </body> |
| </html> |