00001 /* 00002 * MultiplexingMapListener.hpp 00003 * 00004 * Copyright (c) 2000, 2020, 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_MULTIPLEXING_MAP_LISTENER_HPP 00017 #define COH_MULTIPLEXING_MAP_LISTENER_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/MapEvent.hpp" 00022 #include "coherence/util/MapListener.hpp" 00023 00024 COH_OPEN_NAMESPACE2(coherence,util) 00025 00026 00027 /** 00028 * A base class that simplifies the implementation of a MapListener by 00029 * multiplexing all events into a single listener method. 00030 * 00031 * @author djl 2008.06.23 00032 */ 00033 class COH_EXPORT MultiplexingMapListener 00034 : public abstract_spec<MultiplexingMapListener, 00035 extends<Object>, 00036 implements<MapListener> > 00037 { 00038 // ----- MultiplexingMapListener interface ------------------------------ 00039 00040 public: 00041 /** 00042 * Invoked when a map entry has been inserted, updated or deleted. To 00043 * determine what action has occurred, use MapEvent::getId(). 00044 * 00045 * @param vEvent the MapEvent carrying the insert, update or delete 00046 * information 00047 */ 00048 virtual void onMapEvent(MapEvent::View vEvent) = 0; 00049 00050 00051 // ----- MapListener interface ------------------------------------------ 00052 00053 public: 00054 /** 00055 * {@inheritDoc} 00056 */ 00057 virtual void entryInserted(MapEvent::View vEvent); 00058 00059 /** 00060 * {@inheritDoc} 00061 */ 00062 virtual void entryUpdated(MapEvent::View vEvent); 00063 00064 /** 00065 * {@inheritDoc} 00066 */ 00067 virtual void entryDeleted(MapEvent::View vEvent); 00068 }; 00069 00070 COH_CLOSE_NAMESPACE2 00071 00072 #endif // COH_MULTIPLEXING_MAP_LISTENER_HPP