Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | The Adapter Definition | Deploying the adapter | Creating Adapter Startup and Shutdown Java Services | Creating Java Services for Adapter Startup and Shutdown using Designer
 
Creating Java Services for Adapter Startup and Shutdown using Designer
1. Start Designer.
2. Select the webMethods package you created using Designer.
3. Create a folder structure for the Java package for adapter admin Java Services. In the example, the folder structure created is adapterPackageName\code\source\wm\MyAdapter\MyAdapterAdmin.
Note:
You must create your Java package and classes in the adapterPackageName\code\source folder in the webMethods package you created using Designer.
4. Create a new Java Service for adapter startup. In the example, the Java Service created is startUp.
a. Add the following Java code.
public static final void startUp(IData pipeline) throws ServiceException {
// --- <<IS-START(startUp)>> ---
AdapterAdmin.registerAdapter(MyAdapter.getInstance());
// --- <<IS-END>> ---
}
Note:
Tags are used to mark the beginning and end of imports and methods. For more information, see webMethods Service Development Help.
5. Create a new Java Service for adapter shutdown. In the example, the Java Service created is shutDown.
a. Add the following Java code.
public static final void shutDown(IData pipeline) throws ServiceException {
// --- <<IS-START(shutDown)>> ---
MyAdapter instance = MyAdapter.getInstance();
instance.cleanup();
AdapterAdmin.unregisterAdapter(instance);
// --- <<IS-END>> ---
}
Note:
Tags are used to mark the beginning and end of imports and methods. For more information, see webMethods Service Development Help.