Class EventDispatcher


  • public class EventDispatcher
    extends java.lang.Object
    • Field Detail

      • m_logger

        private final Logger m_logger
      • m_thread

        private static java.lang.Thread m_thread
      • m_threadLock

        private static final java.lang.String m_threadLock
      • m_references

        private static int m_references
      • m_stopping

        private static volatile boolean m_stopping
      • m_secureAction

        private static final SecureAction m_secureAction
    • Method Detail

      • startDispatching

        public void startDispatching()
      • stopDispatching

        public void stopDispatching()
      • addListener

        public Filter addListener​(BundleContext bc,
                                  java.lang.Class clazz,
                                  java.util.EventListener l,
                                  Filter filter)
      • removeListeners

        public void removeListeners​(BundleContext bc)
      • updateListener

        public Filter updateListener​(BundleContext bc,
                                     java.lang.Class clazz,
                                     java.util.EventListener l,
                                     Filter filter)
      • getAllServiceListeners

        public java.util.Collection<ListenerHook.ListenerInfo> getAllServiceListeners()
        Returns all existing service listener information into a collection of ListenerHook.ListenerInfo objects. This is used the first time a listener hook is registered to synchronize it with the existing set of listeners.
        Returns:
        Returns all existing service listener information into a collection of ListenerHook.ListenerInfo objects
      • fireFrameworkEvent

        public void fireFrameworkEvent​(FrameworkEvent event)
      • fireServiceEvent

        public void fireServiceEvent​(ServiceEvent event,
                                     java.util.Dictionary oldProps,
                                     Framework felix)
      • fireEventAsynchronously

        private static void fireEventAsynchronously​(EventDispatcher dispatcher,
                                                    int type,
                                                    java.util.Map<BundleContext,​java.util.List<ListenerInfo>> listeners,
                                                    java.util.EventObject event)
      • fireEventImmediately

        private static void fireEventImmediately​(EventDispatcher dispatcher,
                                                 int type,
                                                 java.util.Map<BundleContext,​java.util.List<ListenerInfo>> listeners,
                                                 java.util.EventObject event,
                                                 java.util.Dictionary oldProps)
      • invokeFrameworkListenerCallback

        private static void invokeFrameworkListenerCallback​(Bundle bundle,
                                                            java.util.EventListener l,
                                                            java.util.EventObject event)
      • invokeBundleListenerCallback

        private static void invokeBundleListenerCallback​(Bundle bundle,
                                                         java.util.EventListener l,
                                                         java.util.EventObject event)
      • invokeServiceListenerCallback

        private static void invokeServiceListenerCallback​(Bundle bundle,
                                                          java.util.EventListener l,
                                                          Filter filter,
                                                          java.lang.Object acc,
                                                          java.util.EventObject event,
                                                          java.util.Dictionary oldProps)
      • run

        private static void run()
        This is the dispatching thread's main loop.