接口 ListenerHook.ListenerInfo

  • 所有已知实现类:
    ListenerInfo
    封闭接口:
    ListenerHook

    @ProviderType
    public static interface ListenerHook.ListenerInfo
    Information about a Service Listener. This interface describes the bundle which added the Service Listener and the filter with which it was added.
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      boolean equals​(java.lang.Object obj)
      Compares this ListenerInfo to another ListenerInfo.
      BundleContext getBundleContext()
      Return the context of the bundle which added the listener.
      java.lang.String getFilter()
      Return the filter string with which the listener was added.
      int hashCode()
      Returns the hash code for this ListenerInfo.
      boolean isRemoved()
      Return the state of the listener for this addition and removal life cycle.
    • 方法详细资料

      • getBundleContext

        BundleContext getBundleContext()
        Return the context of the bundle which added the listener.
        返回:
        The context of the bundle which added the listener.
      • getFilter

        java.lang.String getFilter()
        Return the filter string with which the listener was added.
        返回:
        The filter string with which the listener was added. This may be null if the listener was added without a filter.
      • isRemoved

        boolean isRemoved()
        Return the state of the listener for this addition and removal life cycle. Initially this method will return false indicating the listener has been added but has not been removed. After the listener has been removed, this method must always return true.

        There is an extremely rare case in which removed notification to ListenerHooks can be made before added notification if two threads are racing to add and remove the same service listener. Because ListenerHooks are called synchronously during service listener addition and removal, the Framework cannot guarantee in-order delivery of added and removed notification for a given service listener. This method can be used to detect this rare occurrence.

        返回:
        false if the listener has not been been removed, true otherwise.
      • equals

        boolean equals​(java.lang.Object obj)
        Compares this ListenerInfo to another ListenerInfo. Two ListenerInfos are equals if they refer to the same listener for a given addition and removal life cycle. If the same listener is added again, it must have a different ListenerInfo which is not equal to this ListenerInfo.
        覆盖:
        equals 在类中 java.lang.Object
        参数:
        obj - The object to compare against this ListenerInfo.
        返回:
        true if the other object is a ListenerInfo object and both objects refer to the same listener for a given addition and removal life cycle.
      • hashCode

        int hashCode()
        Returns the hash code for this ListenerInfo.
        覆盖:
        hashCode 在类中 java.lang.Object
        返回:
        The hash code of this ListenerInfo.