类 Subscriber<T extends Event>

  • 直接已知子类:
    SmartSubscriber

    public abstract class Subscriber<T extends Event>
    extends java.lang.Object
    An abstract subscriber class for subscriber interface.
    作者:
    liaochuntao, zongtanghu
    • 构造器概要

      构造器 
      构造器 说明
      Subscriber()  
    • 方法概要

      所有方法 实例方法 抽象方法 具体方法 
      修饰符和类型 方法 说明
      java.util.concurrent.Executor executor()
      It is up to the listener to determine whether the callback is asynchronous or synchronous.
      boolean ignoreExpireEvent()
      Whether to ignore expired events.
      abstract void onEvent​(T event)
      Event callback.
      boolean scopeMatches​(T event)
      Whether the event's scope matches current subscriber.
      abstract java.lang.Class<? extends Event> subscribeType()
      Type of this subscriber's subscription.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Subscriber

        public Subscriber()
    • 方法详细资料

      • onEvent

        public abstract void onEvent​(T event)
        Event callback.
        参数:
        event - Event
      • subscribeType

        public abstract java.lang.Class<? extends Event> subscribeType()
        Type of this subscriber's subscription.
        返回:
        Class which extends Event
      • executor

        public java.util.concurrent.Executor executor()
        It is up to the listener to determine whether the callback is asynchronous or synchronous.
        返回:
        Executor
      • ignoreExpireEvent

        public boolean ignoreExpireEvent()
        Whether to ignore expired events.
        返回:
        default value is Boolean.FALSE
      • scopeMatches

        public boolean scopeMatches​(T event)
        Whether the event's scope matches current subscriber. Default implementation is all scopes matched. If you override this method, it better to override related Event.scope().
        参数:
        event - Event
        返回:
        Whether the event's scope matches current subscriber