Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | The Adapter Definition | Deploying the Adapter | Compiling the Adapter
 
Compiling the Adapter
Before you load your adapter, you must compile your implementation classes and construct the Java service nodes for your startup and shutdown services.
The following example code uses jcode. To see instructions for using jcode to generate Java services, see the webMethods Service Development Help for your release.
Note:
Make sure that you have modified your classpath as described in Modifying Your Classpath.
<?xml version="1.0"?>
<project default="classes">
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="off"/>
<property name="webM.home" value="../.."/>
<!-- Installation directory of the webMethods -->
<property name="server.home" value="${webM.home/IntegrationServer}"/>
<!-- Directory of the IntegrationServer -->
<property name="server.home" value="../.."/>
<property="package" value = "MyAdapter" /> <!--needed for jcode -->
<!-- classes belonging to this package -->
<path id="this.package.classpath">
<fileset dir=".">
<include name="code/classes"/>
</fileset>
</path>
<!-- All classes that need to be found by this script -->
<path id="total.classpath">
<pathelement
location="${server.home}/packages/WmART/code/jars/wmart.jar"/>
<pathelement location="${server.home}/lib/wm-isserver.jar"/>
<pathelement location="${server.home}/lib/wm-isclient.jar"/>
<pathelement location="${webM.home}/common/lib/glassfish/gf.javax.resource.jar"/>
<path refid="this.package.classpath"/>
</path>
<!-- Compile the java files of this package -->
<target name="classes" depends="init">
<mkdir dir="code/classes"/>
<javac debug="${debug}" optimize="${optimize}"
deprecation="${deprecation}" srcdir="code/source"
destdir="code/classes">
<classpath>
<path refid="total.classpath"/>
</classpath>
</javac>
<!-- needed for jcode -->
<exec executable ="${server.home}/bin/jcode"
vmlauncher = "false" failonerror = "true">
<arg value = "fragall" />
<arg value = "${package}" />
</exec>
</target>
<!-- delete .class files built in this package -->
<target name="cleanclasses">
<mkdir dir="code/classes"/>
<delete quiet="false">
<fileset dir="code/classes" includes="**/*.class"/>
</delete>
</target>
<!-- if this package depends on classes found in other packages,
add targets to build those classes here. -->
<target name="packageDependencies" depends=""/>
<target name="init">
<tstamp/>
</target>
<target name="all" depends="packageDependencies, classes" />
<target name="clean" depends="cleanclasses"/>
<target name="remake" depends="clean, packageDependencies, classes"/>
</project>