Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Usage Scenarios | How to register an adapter with the Integration Server? | Compiling the Adapter
 
Compiling the Adapter
1. Create an ANT script to compile the adapter classes, and deploy the admin classes as Java Services. For example: build.xml and build.properties.
File build.properties:
# The Site Name
debug=on
optimize=off
deprecation=off
webM.home=C:/softwareag/912
server.home=${webM.home}/IntegrationServer
package=MyAdapter
instance_name=default
srcdir=${server.home}/instances/${instance_name}/packages/${package}/code/source
destdir=${server.home}/instances/${instance_name}/packages/${package}/code/classes
File build.xml:
<?xml version="1.0"?>
<project name="Adapter using ADK" default="deploy" basedir=".">
<property file="build.properties" />
<!-- classes belonging to this package -->
<path id="this.package.classpath">
<fileset dir="${server.home}/instances/${instance_name}/packages/${package}/">
<include name="code/classes"/>
</fileset>
</path>

<!-- All classes that need to be found by this script -->
<path id="total.classpath">
<pathelement location="${server.home}/instances/${instance_name}/packages/WmART/code/jars/wmart.jar"/>
<pathelement location="${server.home}/lib/wm-isserver.jar"/>
<pathelement location="${webM.home}/common/lib/wm-isclient.jar"/>
<pathelement location="${webM.home}/common/lib/glassfish/gf.jakarta.resource.jar"/>
<pathelement location="${server.home}/instances/${instance_name}/packages/WmART/code/classes/"/>
<path refid="this.package.classpath"/>
</path>
<!-- Compile the java files of this package -->
<target name="createclasses" depends="init">
<echo>Creating classes</echo>
<mkdir dir="${destdir}/"/>
<javac debug="${debug}" optimize="${optimize}"
deprecation="${deprecation}" srcdir="${srcdir}"
destdir="${destdir}">
<classpath>
<path refid="total.classpath"/>
</classpath>
</javac>
</target>

<!-- Execute jcode -->
<target name="execjcode" depends="createclasses">
<echo>Deploying classes</echo>
<exec executable="${server.home}/instances/${instance_name}/bin/jcode"
vmlauncher="false" failonerror="true">
<arg value="fragall" />
<arg value="${package}" />
</exec>
</target>

<!-- delete .class files built in this package -->
<target name="cleanclasses">
<echo>Cleaning classes</echo>
<mkdir dir="${destdir}"/>
<delete quiet="false">
<fileset dir="${destdir}" includes="**/*.class"/>
</delete>
</target>

<!-- if this package depends on classes found in other packages,
add targets to build those classes here. -->
<target name="init">
<tstamp/>
</target>

<target name="packageDependencies" depends="" />
<target name="clean" depends="cleanclasses" />
<target name="classes" depends="cleanclasses, createclasses" />
<target name="deploy" depends="execjcode" />
<target name="all" depends="packageDependencies, cleanclasses, execjcode" />
<target name="remake" depends="packageDependencies, cleanclasses, createclasses" />

</project>
a. Set the classpath in total.classpath in the ANT script.
The JAR files required to compile your source code are as follows:
*Software AG_directory \common\lib\wm-isclient.jar
*Software AG_directory \common\lib\glassfish\gf.jakarta.resource.jar
*Integration Server_directory \lib\wm-isserver.jar
*Integration Server_directory \instances\<instance_name>\packages\WmART\code\jars\wmart.jar
The folder containing the class files required to compile your source code is as follows:
*Integration Server_directory \instances\<instance_name>\packages\WmART\code\classes
Software AG_directory is the folder in which webMethods components are installed and Integration Server_directory is the folder in which Integration Server is installed.
2. Run the ANT script to compile the Java classes.
ant classes
3. Compile the Java classes and deploy in Integration Server as Java Services.
a. Run the ANT script to compile the Java classes and deploy in Integration Server as Java Services.
ant deploy
Note:
If you have created adapter admin Java class for startup and shutdown, then the corresponding Java Services are deployed using jcode utility. The jcode utility is provided with Integration Server. For more information, see webMethods Service Development Help.
b. If you have created startup and shutdown Java Services using Designer, you must compile it using Integration Server Administrator.
*Start Integration Server Administrator.
*Select Settings > Extended > Edit Extended Settings.
*Set the property watt.server.compile to include the path to Java compiler and the classpath to include the wmart.jar in Integration Server_directory \instances\<instance_name>\packages\WmART\code\jars\wmart.jar. For example:
watt.server.compile=C:\softwareag\912\jvm\jvm\bin\javac
-classpath {0};C:\softwareag\912\IntegrationServer\instances\default\packages\
WmART\code\jars\wmart.jar; -d {1} {2}
4. Restart Integration Server.
5. Refresh Designer.
The Java Services are deployed. The startup and shutdown Java Services appear.