Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Listener Notifications | Listener Implementation | Defining a WmConnectedListener Implementation Class | Implementing the shutdownCallBack() Method
 
Implementing the shutdownCallBack() Method
Invoked on a thread separate from the listener's thread, this method allows the listener's waitForData loop to be gracefully interrupted prior to a normal shutdown. The thread that initiates listenerShutdown invokes shutdownCallBack 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
Because shutdownCallBack is called from within an external thread (that is, not the same thread in which the listener itself is executing), you can take advantage of this feature to gracefully interrupt the normal functioning of the waitForData method. The listenerShutdown method will be subsequently invoked by WmART on the listener's thread. This is where you should perform any listener-specific cleanup tasks.