The Droplets-ATG Dynamo Bridge |
||||||
Overview The Droplets Java SDK includes a Bridge that allows you to deploy the Droplets Platform in conjunction with the ATG Dynamo application server. Using this Droplets-Dynamo bridge, Droplets UI Servers (presentation layer) can interact seamlessly with Dynamo application servers (business logic), and your UI logic can access Dynamo components just as if it were a Web request.
This document assumes a knowledge of basic Dynamo concepts, most notably the difference between "session-scoped" and "global-scoped" components and some basic familiarity with Servlets and the Dynamo Server's Classpath. For more information on Dynamo, see www.atg.com.
OverviewThe Droplets-Dynamo Bridge is a mechanism for integrating Dynamo ATG-based applications with Droplets Platform UIs. The Bridge resides on the Dynamo application server, along with two additional files (outlined in Deployment below). The Dynamo ATG application server is designed to support Servlet-based Web applications making HTTP requests to Dynamo components. The Servlets call Dynamo components and are thus able to transmit Web page updates based on the application logic.
The Droplets-Dynamo Bridge allows you to replace this Web-based setup with the Droplets Platform's component-based UI architecture. In this scenario, the presentation layer of your Internet application resides on the Droplets UI Server, with the rest of your business logic remaining unchanged on the Dynamo Server. A "Droplets Adapter" file (the actual Bridge) resides on the Dynamo Server and mediates communication between the Droplets UI Server and Dynamo components, without requiring any intervention by your developers. The only portion of your pre-existing Dynamo application's code that will have to be altered to work with the Droplets Platform is the presentation layer all other application logic will remain the same.
The Droplets-Dynamo Bridge Java API contains five separate classes:
In addition to the two exception classes outlined above, the methods of DynamoSessionAdapter each have their own exceptions which are thrown. For more details on these, see the DropletsDynamoBridge package API documentation. Every Droplets user session has its own instance of the DynamoSessionAdapter, which gives it access to session-specific Dynamo components. This Adapter connects to the bridge using RMI, which means that Dynamo's RMI service must be running and that the bridge must be configured as an exported RMI service (more on that in Deployment). Adapter objects are not reusable; when a session ends they are destroyed, and so a new adapter object must be created for each session. The Bridge resides on the Dynamo Server and allows Client code to retrieve Dynamo components. These components are either remote objects, in which case the RMIC compiler must have been run on them, and the getSessionComponent() and getGlobalComponent() objects will return a remote reference to them; or serializable, in which case those getSessionComponent() and getGlobalComponent() will construct and return a copy of them. The Droplets-Dynamo Bridge classes are contained in a .jar file that is included as a part of the Droplets Platform SDK. The other two necessary files, a .jhtml and a .properties file, are included in the SDK as well.
Application DevelopmentWriting to the DropletDynamoBridge is straightforward, and involves the instantiation of a DynamoSessionAdapter object for each user session, and the use of this object's two getComponent() methods each time the presentation layer must interact with the business logic. The only part of an existing Dynamo-based application that you have to alter for the Droplets Platform is the presentation layer, which will reside on the Droplets UI Server. The presentation layer will be re-written to conform to the Droplets Platform model, in which an Application object contains a Window, the Window contains one or more Panels, the Panels contain all Components, and Event Listeners are wired to the Components as required. For full details of writing to the Droplets Java API, see the Hello World Java tutorial. In order for the Droplets UI Server to communicate with the Dynamo Server's business logic, a few steps need to be followed in writing your presentation layer: 1. Import the com.droplets.dynamo package.
2. Create a DynamoSessionAdapter object. This should be done in the Window object's start() method by declaring an Adapter variable within the Window object:
and then instantiating it as follows:
8860 is the port through which the Droplets UI Server speaks to the Dynamo Server. 3. Destroy the DynamoSessionAdapter.
This should be done in the Window object's stop() method:
4. When
interacting with Dynamo components:
For more details on programming to the Droplets-Dynamo Bridge, consult the DynamoBridge API documentation.
DeploymentGeneral issues related to deployment of the Droplets Platform and the Dynamo ATG application server are addressed in their respective documentation (click here for information on Droplets Platform deployment). This section deals only with Droplets-Dynamo Bridge-specific deployment issues. The Droplets UI Server and Dynamo Application Server need not be and probably will not be deployed on the same machine. This presents no problem provided that the .properties files outlined below are configured properly. The Droplets SDK includesa .jar file named DynamoBridge.jar that (upon installation) is placed at:
This .jar file contains all Java classes necessary to operate the Droplets-Dynamo Bridge. The Droplets Server will be able to unzip and access these files from the .jar file without further configuration, but you'll have to place this file on the Dynamo Application Server's host machine as well, and include it in the Dynamo Server's Classpath; consult Dynamo ATG documentation for details on how to set the Dynamo Server's Classpath. Included in DynamoBridge.jar are the following files: DynamoSessionAdapter: Used by the Droplets Server DropletDynamoBridgeImpl: Used by the Dynamo Server DropletDynamoBridge: Used by both servers InvalidSessionIDException: Used by both servers SessionCreationException: Used by both servers
In addition to DynamoBridge.jar, the following two additional files must be manually placed within the Dynamo Server. As with the .jar, these files are also located within your SDK directory at:
DROPLET_componentRetriever.jhtml: Must be placed in the Web server's root directory, corresponding to the relative path configured in the jhtmlPageName property in DropletDynamoBridge.properties; see Dynamo ATG documentation for more on this. If that property is left out, the default location for DROPLET_componentRetriever.jhtml, is the Web server's root directory. DropletDynamoBridge.properties: Must be installed in Dynamo's CONFIGPATH such that the instantiated component name becomes "/com/droplets/dynamo/DropletDynamoBridge". Normally, this means that the file must be placed in a directory tree entitled com/droplets/dynamo beneath some directory specified in Dynamo's CONFIGPATH. In addition, there are three properties that must be set within this properties file, provided the defaults do not apply; these are necessary because the Bridge is in effect contacting Dynamo's Web server, and must thus specify that Web server's HTTP port and hostname. These are outlined below:
Dynamo configuration: Before deploying, you must also configure Dynamo's RMI server in order to expose the Droplets-Dynamo Bridge as a remote service. In order to accomplish this, the following line:
must be added to the "exportedServices" property of the Dynamo component by the name of:
In Dynamo 5.0, this can be done using the Component Browser in Dynamo Control Center. In Dynamo 4.1, you must create an RmiServer.properties file, place it somewhere in Dynamo's CONFIGPATH under the directory structure atg/dynamo/server, and include the following line:
See the ATG Dynamo application server's documentation for more details on this. |