00001 /* 00002 * Copyright (c) 2000, 2020, Oracle and/or its affiliates. 00003 * 00004 * Licensed under the Universal Permissive License v 1.0 as shown at 00005 * http://oss.oracle.com/licenses/upl. 00006 */ 00007 #ifndef COH_MAP_EVENT_TRANSFORMER_HPP 00008 #define COH_MAP_EVENT_TRANSFORMER_HPP 00009 00010 #include "coherence/lang.ns" 00011 00012 #include "coherence/util/MapEvent.hpp" 00013 00014 COH_OPEN_NAMESPACE2(coherence,util) 00015 00016 00017 /** 00018 * MapEventTransformer interface is used to allow an event consumer to change 00019 * the content of a MapEvent destined for the corresponding MapListener. 00020 * 00021 * In general, the #transform method is called after the 00022 * original MapEvent is evaluated by a Filter (such as 00023 * coherence::util::filter::MapEventFilter). The values contained by the 00024 * returned MapEvent object will be the ones given (sent) to the 00025 * corresponding listener. Returning null will prevent the emission of the 00026 * event altogether. 00027 * 00028 * <b>Note:</b> Currently, the MapEventTransformer interface is supported only 00029 * by partitioned caches. 00030 * 00031 * @see coherence::util::filter::MapEventTransformerFilter 00032 * 00033 * @author djl 2008.05.22 00034 */ 00035 class COH_EXPORT MapEventTransformer 00036 : public interface_spec<MapEventTransformer> 00037 { 00038 // ----- MapEventTransformer interface ---------------------------------- 00039 00040 public: 00041 /** 00042 * Transform the specified MapEvent. The values contained by the 00043 * returned MapEvent object will be the ones given (sent) to the 00044 * corresponding listener. 00045 * 00046 * @param hEvent the original MapEvent object 00047 * 00048 * @return modified MapEvent object or NULL to discard the event 00049 */ 00050 virtual MapEvent::Handle transform( 00051 MapEvent::Handle hEvent) const = 0; 00052 }; 00053 00054 COH_CLOSE_NAMESPACE2 00055 00056 #endif // COH_MAP_EVENT_TRANSFORMER_HPP