高级自定义 > Info*Engine Java 适配器开发 > Developing an Adapter Using the JADK
Developing an Adapter Using the JADK
Before developing a custom adapter, verify that a compatible version of Windchill is already installed at your site. The JADK depends on the Java class files of Info*Engine for specific implementation needs. By default, Info*Engine is installed as a bundled component of Windchill. For more information, see the section Info*Engine User’s Guide.
Preparing to Write the Custom Adapter
Decide if you want to create a single-threaded or a multi-threaded adapter. This choice determines which files you copy during the installation process.
The following procedure assumes you are installing a single-threaded adapter. If you install a multi-threaded adapter, you must choose the multi-threaded versions of all the files required by the installation process. For more information about single-threaded and multi-threaded adapters, see JADK Classes and Interfaces.
1. Copy all the files and directories from the top-level directory of the Windchill Info*Engine Java Adapter Developer’s Kit CD to your host.
2. Create a local development path on your development host.
* 
This is the location where you code your webjects along with your implementation and main classes.
3. Copy the jadk.jar file into your local development path or the Info*Engine installation directory.
For example, if Info*Engine is installed in a specific directory such as /usr/infoengine, copy the jadk.jar file into the same location.
4. Copy the sample implementation and main classes to an appropriate location.
5. Choose the implementation and main classes appropriate for your adapter and copy two files to your current development directory:
Co-Resident Adapter
Single-Threaded Adapters
JADKAdapterImpl.java
Multi-Threaded Adapters
JADKMultithreadedAdapterImpl.java
Standalone Adapter
Single-Threaded Adapters
JADKAdapter.java
JADKAdapterImpl.java
Multi-Threaded Adapters
JADKMultithreadedAdapter.java
JADKMultithreadedAdapterImpl.java
6. Give your adapter a name by renaming the implementation class and the main class.
Choose names that match the technology and ensure the names are easily identifiable. For instance, if you are developing a custom LDAP adapter, you should rename the implementation class from JADKAdapterImpl.java to ldapAdapterImpl.java. You should also rename the adapter main class from JADKAdapter.java to ldapAdapter.java.
7. Change the SocketAccess parameter in the main class file and replace all the JADKAdapterImpl references in the implementation class to reflect the name you specified for the implementation class in the previous step.
While other changes are possible to this file, they are usually unnecessary.
8. Copy the build.xml file to the development directory in which you plan to work.
9. Update the classpath references, the target JAR file name, and its destination directory as appropriate in the build.xml file to reflect the name of your new adapter.
10. Use the Generic Adapter property form to configure the adapter to use the properties defined in your LDAP directory.
11. Rename and change the startJADK.sh or startJADK.cmd file to use appropriate values for the environment variables (such as JAVA_HOME, WEB_APP_HOME and so on) and for the service and package names of the adapter you are creating.
这对您有帮助吗?