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 | Creating Adapter Startup and Shutdown Services | Example Adapter Startup and Shutdown Services
 
Example Adapter Startup and Shutdown Services
The following example shows the startup and shutdown services used by My Adapter (with appropriate jcode tags):
package com.mycompany.adapter.myadapter;
import com.wm.adk.admin.AdapterAdmin;
import com.wm.data.IData;
import com.wm.app.b2b.server.ServiceException;
public class MyAdapterAdmin
{
public static void registerAdapter(IData pipeline) throws ServiceException
{
// --- <<IS-START(registerAdapter)>> ---
AdapterAdmin.registerAdapter(MyAdapter.getInstance());
// --- <<IS-END>> ---
}
public static void unregisterAdapter(IData pipeline) throws ServiceException
{
// --- <<IS-START(unregisterAdapter)>> ---
MyAdapter instance = MyAdapter.getInstance();
instance.cleanup();
AdapterAdmin.unregisterAdapter(instance);
// --- <<IS-END>> ---
}
}