Class EventHandler<E extends com.tangosol.net.events.Event<T>,​T extends Enum<T>>

  • Type Parameters:
    E - the type of Event this interceptor accepts
    T - the enumeration of event types E supports
    All Implemented Interfaces:
    com.tangosol.net.events.EventDispatcherAwareInterceptor<E>, com.tangosol.net.events.EventInterceptor<E>
    Direct Known Subclasses:
    CacheEventHandler, CoherenceLifecycleEventHandler, LifecycleEventHandler, ServiceEventHandler, SessionLifecycleEventHandler

    public abstract class EventHandler<E extends com.tangosol.net.events.Event<T>,​T extends Enum<T>>
    extends Object
    implements com.tangosol.net.events.EventDispatcherAwareInterceptor<E>
    Abstract base class for all observer-based interceptors.
    Since:
    3.0
    Author:
    Gunnar Hillert
    • Field Detail

      • observer

        protected final MethodEventObserver<E extends com.tangosol.net.events.Event<T>> observer
        The observer method to delegate events to.
      • eventTypes

        protected final EnumSet<T extends Enum<T>> eventTypes
        A set of event types the observer is interested in.
    • Method Detail

      • introduceEventDispatcher

        public void introduceEventDispatcher​(String identifier,
                                             com.tangosol.net.events.EventDispatcher dispatcher)
        Specified by:
        introduceEventDispatcher in interface com.tangosol.net.events.EventDispatcherAwareInterceptor<E extends com.tangosol.net.events.Event<T>>
      • onEvent

        public void onEvent​(E event)
        Specified by:
        onEvent in interface com.tangosol.net.events.EventInterceptor<E extends com.tangosol.net.events.Event<T>>
      • getId

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

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

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