Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Listener Notifications | Listener Implementation | Defining a WmConnectedListener Implementation Class
 
Defining a WmConnectedListener Implementation Class
1. Create a class by extending com.wm.adk.notification.WmConnectedListener base class. In this example, the class created is SimpleListener.
2. Add skeletal implementation of the abstract methods.
3. Implement the shutdownCallBack method.
The shutdownCallBack method is invoked on a thread separate from the listener's thread. This feature allows the listener's waitForData loop to be gracefully interrupted prior to a normal shutdown. The thread that initiates listenerShutdown method invokes shutdownCallBack method in the following situations:
*When the listener node is disabled.
*When the package containing the listener node is reloaded.
*When Integration Server shuts down.
The system passes to this method a reference to the underlying resource connection. The method is invoked prior to calling the listener's listenerShutdown method. It will not be called if the shutdown is due to an exception.
The signature of this method is:
public void shutdownCallBack(WmManagedConnection wmConn) throws
ResourceException
The listenerShutdown method is subsequently invoked by WmART on the listener's thread. This is where you must perform any listener-specific cleanup tasks.