00001 /* 00002 * MapTriggerListener.hpp 00003 * 00004 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. 00005 * 00006 * Oracle is a registered trademarks of Oracle Corporation and/or its 00007 * affiliates. 00008 * 00009 * This software is the confidential and proprietary information of Oracle 00010 * Corporation. You shall not disclose such confidential and proprietary 00011 * information and shall use it only in accordance with the terms of the 00012 * license agreement you entered into with Oracle. 00013 * 00014 * This notice may not be removed or altered. 00015 */ 00016 #ifndef COH_MAP_TRIGGER_LISTENER_HPP 00017 #define COH_MAP_TRIGGER_LISTENER_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/MapEvent.hpp" 00022 #include "coherence/util/MapTrigger.hpp" 00023 #include "coherence/util/MultiplexingMapListener.hpp" 00024 00025 COH_OPEN_NAMESPACE2(coherence,util) 00026 00027 00028 /** 00029 * MapTriggerListener is a special purpose MapListener implementation that is 00030 * used to register a MapTrigger on a corresponding ObservableMap. 00031 * 00032 * <b>Note:</b> Currently, the MapTriggerListener can only be registered 00033 * with partitioned caches and only "globally" (without specifying any filter 00034 * or key), using the ObservableMap::addMapListener() method. 00035 * 00036 * @author djl 2008.06.23 00037 */ 00038 class COH_EXPORT MapTriggerListener 00039 : public class_spec<MapTriggerListener, 00040 extends<MultiplexingMapListener> > 00041 { 00042 friend class factory<MapTriggerListener>; 00043 00044 // ----- constructors --------------------------------------------------- 00045 00046 protected: 00047 /** 00048 * Construct a MapTriggerListener that can be used to register the 00049 * specified MapTrigger. 00050 * 00051 * @param hTrigger the MapTrigger 00052 */ 00053 MapTriggerListener(MapTrigger::Handle hTrigger); 00054 00055 00056 // ----- MultiplexingMapListener interface ------------------------------ 00057 00058 public: 00059 /** 00060 * {@inheritDoc} 00061 */ 00062 virtual void onMapEvent(MapEvent::View vEvent); 00063 00064 00065 // ----- accessors ------------------------------------------------------ 00066 00067 public: 00068 /** 00069 * Obtain the MapTrigger agent represented by this TriggerListener. 00070 * 00071 * @return the MapTrigger agent represented by this TriggerListener 00072 */ 00073 virtual MapTrigger::View getTrigger() const; 00074 00075 /** 00076 * Obtain the MapTrigger agent represented by this TriggerListener. 00077 * 00078 * @return the MapTrigger agent represented by this TriggerListener 00079 */ 00080 virtual MapTrigger::Handle getTrigger(); 00081 00082 00083 // ----- data members --------------------------------------------------- 00084 00085 protected: 00086 /** 00087 * The underlying MapTrigger. 00088 */ 00089 FinalHandle<MapTrigger> f_hTrigger; 00090 }; 00091 00092 COH_CLOSE_NAMESPACE2 00093 00094 #endif // COH_MAP_TRIGGER_LISTENER_HPP