Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Listener Notifications | Listener Implementation | Specifying Configuration Metadata | Restricting Listeners to Register Specified Notification Templates
 
Restricting Listeners to Register Specified Notification Templates
By default a listener supports all listener notification templates of the adapter. When adapter users configure a new listener notification (either synchronous or asynchronous) using Designer, they may select from the complete list of all enabled listeners in the adapter. You may want to override this default behavior so that the listener implementation specifies exactly which notification templates it supports. To do this, implement the method restrictNotificationTypes in your listener implementation class. This method returns a String array containing the fully qualified path names of one or more notification template classes that the listener will support. Then, when adapter users attempt to configure a new listener notification in Designer, only those template classes in the returned array will appear in the Adapter Notification Editor. The following example shows how to use this method.
public class SimpleListener extends WmConnectedListener
{
...
public String[] restrictNotificationTypes()
{
return new String[]{"com.wm.myadapter.notifications.FooNotification",
"com.wm.myadapter.notifications.BarNotification"};
}
...
}
Note:
All names returned by this method should refer to classes that extend WmNotification.