Class MapListenerProxy

  • All Implemented Interfaces:
    com.tangosol.util.MapListener<Object,​Object>, io.grpc.stub.StreamObserver<MapListenerRequest>, EventListener

    public class MapListenerProxy
    extends Object
    implements io.grpc.stub.StreamObserver<MapListenerRequest>, com.tangosol.util.MapListener<Object,​Object>
    A class to encapsulate bidirectional streaming of map events for a single cache.
    Since:
    20.06
    Author:
    Jonathan Knight 2019.12.03
    • Method Detail

      • onError

        public void onError​(Throwable throwable)
        Specified by:
        onError in interface io.grpc.stub.StreamObserver<MapListenerRequest>
      • onCompleted

        public void onCompleted()
        Specified by:
        onCompleted in interface io.grpc.stub.StreamObserver<MapListenerRequest>
      • entryInserted

        public void entryInserted​(com.tangosol.util.MapEvent<Object,​Object> mapEvent)
        Specified by:
        entryInserted in interface com.tangosol.util.MapListener<Object,​Object>
      • entryUpdated

        public void entryUpdated​(com.tangosol.util.MapEvent<Object,​Object> mapEvent)
        Specified by:
        entryUpdated in interface com.tangosol.util.MapListener<Object,​Object>
      • entryDeleted

        public void entryDeleted​(com.tangosol.util.MapEvent<Object,​Object> mapEvent)
        Specified by:
        entryDeleted in interface com.tangosol.util.MapListener<Object,​Object>
      • addListener

        protected void addListener​(com.tangosol.util.Filter<?> filter,
                                   long filterId,
                                   boolean lite,
                                   boolean priming)
        Add this MapListenerProxy as a filter-based listener of the given NamedCache.
        Parameters:
        filter - the Filter to listen to
        filterId - the unique positive identifier of the Filter
        lite - true to add a "lite" listener
        priming - true if the listener is a priming listener
      • addListener

        protected void addListener​(Object key,
                                   boolean lite,
                                   boolean priming)
        Add this MapListenerProxy as a key-based listener of the given NamedCache.
        Parameters:
        key - the key to listen to deserialized in Object form
        lite - true to add a "lite" listener
        priming - true if the listener is a priming listener
      • addListener

        protected void addListener​(Object key,
                                   boolean lite,
                                   boolean priming,
                                   boolean register)
        Add this MapListenerProxy as a key-based listener of the given NamedCache.
        Parameters:
        key - the key to listen to deserialized in Object form
        lite - true to add a "lite" listener
        priming - true if the listener is a priming listener
        register - true if the listener should be added to the underlying cache
      • ensurePrimingListener

        protected com.tangosol.util.MapListenerSupport.PrimingListener<Object,​Object> ensurePrimingListener()
        Return the priming listener, or it not already cached, create it.
        Returns:
        the priming listener
      • onMapEvent

        protected void onMapEvent​(com.tangosol.util.MapEvent<?,​?> event)
        Convert a MapEvent into a MapEventResponse and send it to the StreamObserver, converting theBinary key and values if required.
        Parameters:
        event - the event to send to the observer
      • createMapEventResponse

        protected MapEventResponse createMapEventResponse​(com.tangosol.util.MapEvent<?,​?> mapEvent)
        Factory method to create new MapEventResponse instances using the information in the supplied MapEvent.
        Parameters:
        mapEvent - the MapEvent used to configure the newly created MapEventResponse
        Returns:
        a MapEventResponse created from the MapEvent