类 DefaultPublisher

    • 嵌套类概要

      • 从类继承的嵌套类/接口 java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void addSubscriber​(Subscriber subscriber)
      Add listener.
      (专用程序包) void checkIsStart()  
      long currentEventSize()
      The number of currently staged events.
      ConcurrentHashSet<Subscriber> getSubscribers()  
      private boolean hasSubscriber()  
      void init​(java.lang.Class<? extends Event> type, int bufferSize)
      Initializes the event publisher.
      boolean isInitialized()  
      void notifySubscriber​(Subscriber subscriber, Event event)
      Notify listener.
      (专用程序包) void openEventHandler()  
      boolean publish​(Event event)
      publish event.
      (专用程序包) void receiveEvent​(Event event)
      Receive and notifySubscriber to process the event.
      void removeSubscriber​(Subscriber subscriber)
      Remove listener.
      void run()  
      void shutdown()
      Shutdown the Resources, such as Thread Pool.
      void start()  
      • 从类继承的方法 java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
      • 从类继承的方法 java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 字段详细资料

      • LOGGER

        protected static final org.slf4j.Logger LOGGER
      • initialized

        private volatile boolean initialized
      • shutdown

        private volatile boolean shutdown
      • eventType

        private java.lang.Class<? extends Event> eventType
      • queueMaxSize

        private int queueMaxSize
      • queue

        private java.util.concurrent.BlockingQueue<Event> queue
      • lastEventSequence

        protected volatile java.lang.Long lastEventSequence
      • UPDATER

        private static final java.util.concurrent.atomic.AtomicReferenceFieldUpdater<DefaultPublisher,​java.lang.Long> UPDATER
    • 构造器详细资料

      • DefaultPublisher

        public DefaultPublisher()
    • 方法详细资料

      • init

        public void init​(java.lang.Class<? extends Event> type,
                         int bufferSize)
        从接口复制的说明: EventPublisher
        Initializes the event publisher.
        指定者:
        init 在接口中 EventPublisher
        参数:
        type - >
        bufferSize - Message staging queue size
      • start

        public void start()
        覆盖:
        start 在类中 java.lang.Thread
      • run

        public void run()
        指定者:
        run 在接口中 java.lang.Runnable
        覆盖:
        run 在类中 java.lang.Thread
      • openEventHandler

        void openEventHandler()
      • hasSubscriber

        private boolean hasSubscriber()
      • checkIsStart

        void checkIsStart()
      • shutdown

        public void shutdown()
        从接口复制的说明: Closeable
        Shutdown the Resources, such as Thread Pool.
        指定者:
        shutdown 在接口中 Closeable
      • isInitialized

        public boolean isInitialized()
      • receiveEvent

        void receiveEvent​(Event event)
        Receive and notifySubscriber to process the event.
        参数:
        event - Event.