Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | The Adapter Definition | Creating a WmAdapter Implementation Class | Initializing and Cleaning Up
 
Initializing and Cleaning Up
In your WmAdapter implementation class, you can initialize resources and properties specific to your adapter when the adapter is enabled. For example, you might initialize the ArtLogger resource. (You can use an ARTLogger object to generate journal log entries for your adapter.) Because there can be only one ArtLogger instance per adapter (that is, per major code), you should manage the ArtLogger instance in your WmAdapter implementation class, but it is optional. You should use a static accessor method, which simply facilitates access to the ArtLogger instance. In the Example WmAdapter Implementation Class, this is accomplished using the getLogger method.
When the adapter is disabled, you must release the ArtLogger instance (and the adapter's major code) using the ArtLogger.close method. In the Example WmAdapter Implementation Class, this is accomplished using MyAdapter.cleanup, which is called from MyAdapterAdmin.unregisterAdapter.
You should release any other resources held by the adapter definition. Resources held by connections, adapter services, and notifications have their own cleanup mechanisms, as described in other chapters.