Preparing Agentry Applications With Java System Connections

When migrating an Agentry application to the SAP® Mobile Platform Server 3.0, it is necessary to account for changes within the architecture that directly affect how the Java synchronization logic of the mobile application processes file references. Note if your application does not include a Java system connection, the information in this section can be ignored.

In releases of the SAP® Mobile Platform prior to 3.0, as well as in releases of the Agentry Mobile Platform versions 6.0.x and earlier, the Java synchronization logic could reference file resources relative to the installation location of the Agentry Server; or within the SAP® Mobile Platform Runtime, relative to the directory created when an Agentry application was defined within the runtime environment. The current directory when the Java logic was processed was always the location of the Agentry Server and file paths to resources to be loaded or processed by the Java logic were relative. For example, the path .\JavaBe.ini would be valid for a file named JavaBe.ini, located within folder where thel Agentry Server was located. In SAP® Mobile Platform version 3.0, the current directory when processing Java logic is no longer the location of the Agentry Server.

This change is the result of the architectural changes made to the Agentry Server within the SAP® Mobile Platform Server. When migrating an Agentry mobile application to the SAP® Mobile Platform version 3.0, it is therefore necessary to make changes to the Java logic and/or those file resources referenced by the Java logic in order to properly migrate the application.

The following information provides the two methods in which this can be handled. The first is to place the referenced files in the main SAP® Mobile Platform Server 3.0 installation directory. The second is to modify the Java synchronization logic for the application to use the method findConifgurationFile within the Agentry Java API class com.syclo.agentry.Server. Of these methods it is the second, modification of the Java synchronization logic, which is recommended.

Configuration File Placement for Java Logic Access

One option while migrating the Agentry application to the SAP® Mobile Platform version 3.0 is to move all configuration files, along with any other resource files referenced by the Java logic into the main installation location of the SAP® Mobile Platform Server 3.0. When files are referenced by a relative path, this location is returned. This requires the directory structure to match that of the Agentry Server as implemented within the Agentry Mobile Platform 6.0.x environment, or within the SAP® Mobile Platform Runtime Environment 2.3.

As an example, if a resource file is located in the directory C:\Agentry\ServerProd\CustomerDLLs\myResource.dll, the same CustomerDLLs directory must be created in the main SAP® Mobile Platform Server 3.0 directory.

This method is not recommended as it introduces potential maintenance challenges that can be avoided by modifying the Java synchronization logic.

Modification of File References Within Java Synchronization Logic

The other, and recommended option for migrating an Agentry mobile application to SAP® Mobile Platform 3.0 is to modify the Java synchronization logic. This modification consists of changing any references to configuration files or other resource files within the logic. In each case where such a file is referenced, it should be replaced with a call to the method com.syclo.agentry.Server.findConfigurationFile. This method takes either the file name or relative path and file name as its parameter and returns the full path to the file. This return value can then be used in the same manner in which the previous relative file path was used in order to process a configuration file.

When making this change it is necessary to first import all development resources, including the Java logic, as well as the Agentry application project into the Agentry Editor plug-in provided in the SAP Mobile SDK 3.0. It is also necessary to update the AJ-API to the version provided with the SAP Mobile SDK 3.0. This API is contained in the Agentry-v5.jar file provided with the SAP Mobile SDK installation.