WebSphere WebSphere Enterprise Service Bus, Version 6.0.1 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Implementing a filter plug-in

You can implement a custom filter plug-in.

Why and when to perform this task

If you want to use your own filtering engine as an emitter filter, you can implement a custom filter plug-in by following these steps:

Steps for this task

  1. Develop your filter plug-in as a Java class implementing the interface com.ibm.events.filter.Filter. This interface defines the following methods:
    isEventEnabled(CommonBaseEvent)
    Returns a boolean value indicating whether the specified event passes the filter criteria. Each time an event is submitted to an emitter, the emitter calls this method, passing the submitted event. If the return value is true, the emitter sends the event to the event server for persistence and distribution. If the return value is false, the emitter discards the event.
    getMetaData()
    Returns information about the filter plug-in, such as the provider name and version number.
    close()
    Frees all resources used by the filter plug-in. This method is called when the close() method of an emitter is called.
  2. Develop a filter factory class that implements the interface com.ibm.events.filter.FilterFactory. This interface defines a single method, getFilter(), which returns an instance of your filter class (an implementation of the Filter interface).
  3. Bind an instance of your filter factory into a JNDI namespace. During initialization, an emitter performs a JNDI lookup to access the filter factory.
  4. In the WebSphere ESB administrative console, modify your emitter factory profile or create a new profile. In the Filter Factory JNDI Name field, specify the JNDI name of your FilterFactory implementation. For more information about emitter factory profiles, see the online help for the administrative console.

Result

When you create an emitter using the emitter factory profile that specifies your filter factory, the new emitter uses an instance of your filter implementation. You can now send events using the standard emitter interfaces, and your filter plug-in is used.

Task topic

Terms of Use | Rate this page

Timestamp iconLast updated: 13 Dec 2005
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.wesb.doc\doc\tcei_admin_filterPlugIn.html

(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)