My Oracle Support Banner

MapEventFilter Doesnot Filter For (Doc ID 1174456.1)

Last updated on MARCH 29, 2017

Applies to:

Oracle Coherence - Version: 3.5.3 and later   [Release: AS10g and later ]
Information in this document applies to any platform.


Using a MapEventFilter in C++ Client triggers events only during Insertion or Deletion:

Below is the sample C++ code:

void _tmain(int /*argc*/, _TCHAR* /*argv*/[])
     const std::string keyFilter = "test%";

     NamedCache::Handle cache = CacheFactory::getCache( CACHE_NAME );

     Filter::View filter;
     if ( !keyFilter.empty() )
        filter = LikeFilter::create( KeyExtractor::create(), keyFilter );

        std::cout << "Cache(" << CACHE_NAME << "): Listening..." << std::endl;
        VerboseMapListener::Handle listener = VerboseMapListener::create();

        Filter::Handle mapFilter = MapEventFilter::create( filter );
        cache->addFilterListener( listener, mapFilter, true );

        std::cout << "Press any key at any time to exit..." << std::endl;

        cache->removeFilterListener( listener, mapFilter );


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.