Class EventObserverSupport.EventHandler<E extends Event<T>,​T extends Enum<T>>

    • Constructor Detail

      • EventHandler

        protected EventHandler​(EventObserverSupport.EventObserver<E> observer,
                               Class<T> classEventType)
        Construct EventHandler instance.
        Parameters:
        observer - the observer method to delegate events to
        classEventType - the class of event type enumeration
    • Method Detail

      • getId

        public String getId()
        Return a unique identifier for this interceptor.
        Returns:
        a unique identifier for this interceptor
      • isApplicable

        protected abstract boolean isApplicable​(EventDispatcher dispatcher,
                                                String sScopeName)
        Return true if this interceptor should be registered with a specified dispatcher.
        Parameters:
        dispatcher - a dispatcher to register this interceptor with
        sScopeName - a scope name the observer is interested in, or null for all scopes
        Returns:
        true if this interceptor should be registered with a specified dispatcher; false otherwise
      • shouldFire

        protected boolean shouldFire​(E event)
        Return true if the event should fire.

        This allows sub-classes to provide additional filtering logic and prevent the observer method notification from happening even after the Coherence server-side event is fired.

        Parameters:
        event - the event to check
        Returns:
        true if the event should fire
      • getEventScope

        protected String getEventScope​(E event)
        Return the scope name of the ConfigurableCacheFactory the specified event was raised from.
        Parameters:
        event - the event to extract scope name from
        Returns:
        the scope name
      • addType

        protected void addType​(T type)
        Add specified event type to a set of types this interceptor should handle.
        Parameters:
        type - the event type to add
      • eventTypes

        protected EnumSet<T> eventTypes()
        Create a final set of event types to register this interceptor for.
        Returns:
        a final set of event types to register this interceptor for
      • getScopeName

        public String getScopeName()
        Return the name of the scope this interceptor should be registered with.
        Returns:
        the name of the scope this interceptor should be registered with
      • removeScope

        protected String removeScope​(String sServiceName)
        Remove the scope prefix from a specified service name.
        Parameters:
        sServiceName - the service name to remove scope prefix from
        Returns:
        service name with scope prefix removed