高级自定义 > Info*Engine Java 适配器开发 > JADK Classes and Interfaces
  
JADK Classes and Interfaces
The following topics provide information on JADK classes and interfaces, as well as JADK structures and APIs.
JADK Implementation Classes
There are two implementation classes available. One is multi-threaded and one is single-threaded.
JADKAdapterImpl
This class provides the single-threaded implementation class needed for Info*Engine to invoke the adapter. Depending on whether you run your adapter in coresident mode or standalone mode, the implementation can be invoked either from the same Java Virtual Machine (JVM) that Info*Engine is running on or from an entirely different JVM.
This class implements the IeProcessor interface defined by Info*Engine. The two required methods are processRequest and initialize:
The processRequest method receives a request from Info*Engine and in turn invokes the adapter webject defined by an adapter implementer.
The initialize method does the data member initialization, including, but not limited to, setting the appropriate service name for the adapter, and passing the logging object to the adapter. The initialize method does the initialization for every request.
JADKMultithreadedAdapterImpl
Similar to the JADKAdapterImpl class, this class provides the multi-threaded implementation needed for Info*Engine to invoke the adapter. Depending on whether you run your adapter in coresident mode or standalone mode, the implementation can be invoked either from the same Java Virtual Machine (JVM) that Info*Engine is currently running on or from a totally different JVM.
This class implements the IeMultithreadedProcessor interface defined by Info*Engine. The two required methods are processRequest and initialize:
The processRequest method receives a request from Info*Engine and then invokes the adapter webject defined by an adapter implementer.
The initialize method does the data member initialization, including, but not limited to, setting the appropriate service name for the adapter, and passing the logging object to the adapter. However, with the multi-threaded model, the initialize method performs a one time initialization for all the requests coming to the same adapter instance.
Common JADK Classes
Several other JADK classes are commonly used.
JADKAdapter and JADKMultithreadedAdapter
JADKAdapter and JADKMultithreadedAdapter provide prototypes for developers who want to write standalone adapters. As the name suggests, JADKMultithreadedAdapter is for multi-threaded adapters and JADKAdapter is for single-threaded adapters.
For an adapter that runs coresident with Info*Engine, these adapter main classes are unnecessary because they only do some of the initializations, such as reading the properties file or log file before passing it to the SocketAccess server class. The SocketAccess server class then creates the server port based on the port defined in your LDAP directory, and then invokes the appropriate implementation class if it receives a request at this port.
RequestContext
This class provides an encapsulation of full-fledged JADK APIs that are intended to make the development process easier by hiding all of the server classes. This way, you do not have to understand much about Info*Engine classes to write your own adapter, and you can focus on the back-end APIs that implement your adapter functionalities. For a detailed API description, see JADK Structures and APIs.
AdapterWebject
This class provides a super class for all of the webjects you develop. Any webject you want to be invoked by the processRequest method has to extend this class.
The AdapterWebject class provides the following methods for you to override: init and processWebject. While the init method passes the RequestContext instance to the adapter for use with your webject, the processWebject method allows you to put in any of your adapter-specific code to implement the adapter webject functionalities. The AdapterWebject class also parses the request name from Info*Engine and builds the webject class name based on the request.
IeQueryObjects, IeCreateObjects, IeDeleteObjects, and IeUpdateObjects
These classes provide the most frequently used adapter webjects that can be used with caching and also provide a prototype for the adapter development.
JADK Interfaces
The adapter developed with JADK uses the installed Info*Engine interfaces IeProcessor and IeMultithreadedProcessor. It does not have its own interface.
Your adapter implementation class uses one of these two interfaces so that Info*Engine can instantiate your implementation class and pass along the request it receives from the web server.