Interface EventProducerInterface

    • Field Detail

      • FIRST_POSITION

        static final int FIRST_POSITION
        The FIRST_POSITION in the queue.
        See Also:
        Constant Field Values
      • LAST_POSITION

        static final int LAST_POSITION
        The LAST_POSITION in the queue.
        See Also:
        Constant Field Values
    • Method Detail

      • getSourceId

        Serializable getSourceId()
                          throws RemoteException
        Provide the sourceId that will be transmitted with the fired Event.
        Returns:
        Serializable; the sourceId that will be transmitted with the fired Event
        Throws:
        RemoteException - if a network failure occurs
      • addListener

        boolean addListener​(EventListenerInterface listener,
                            EventTypeInterface eventType)
                     throws RemoteException
        Add a listener as strong reference to the BEGINNING of a queue of listeners.
        Parameters:
        listener - EventListenerInterface; the listener which is interested at events of eventType
        eventType - EventTypeInterface; the events of interest
        Returns:
        the success of adding the listener. If a listener was already added false is returned
        Throws:
        RemoteException - If a network connection failure occurs.
      • addListener

        boolean addListener​(EventListenerInterface listener,
                            EventTypeInterface eventType,
                            ReferenceType referenceType)
                     throws RemoteException
        Add a listener to the BEGINNING of a queue of listeners.
        Parameters:
        listener - EventListenerInterface; the listener which is interested at events of eventType
        eventType - EventTypeInterface; the events of interest
        referenceType - ReferenceType; whether the listener is added as a strong or as a weak reference
        Returns:
        the success of adding the listener. If a listener was already added false is returned
        Throws:
        RemoteException - If a network connection failure occurs.
        See Also:
        WeakReference
      • addListener

        boolean addListener​(EventListenerInterface listener,
                            EventTypeInterface eventType,
                            int position)
                     throws RemoteException
        Add a listener as strong reference to the specified position of a queue of listeners.
        Parameters:
        listener - EventListenerInterface; the listener which is interested at events of eventType
        eventType - EventTypeInterface; the events of interest
        position - int; the position of the listener in the queue
        Returns:
        the success of adding the listener. If a listener was already added, or an illegal position is provided false is returned
        Throws:
        RemoteException - If a network connection failure occurs.
      • addListener

        boolean addListener​(EventListenerInterface listener,
                            EventTypeInterface eventType,
                            int position,
                            ReferenceType referenceType)
                     throws RemoteException
        Add a listener to the specified position of a queue of listeners.
        Parameters:
        listener - EventListenerInterface; which is interested at certain events
        eventType - EventTypeInterface; the events of interest
        position - int; the position of the listener in the queue
        referenceType - ReferenceType; whether the listener is added as a strong or as a weak reference
        Returns:
        the success of adding the listener. If a listener was already added or an illegal position is provided false is returned
        Throws:
        RemoteException - If a network connection failure occurs.
        See Also:
        WeakReference
      • removeListener

        boolean removeListener​(EventListenerInterface listener,
                               EventTypeInterface eventType)
                        throws RemoteException
        Remove the subscription of a listener for a specific event.
        Parameters:
        listener - EventListenerInterface; which is no longer interested
        eventType - EventTypeInterface; the event which is of no interest any more
        Returns:
        the success of removing the listener. If a listener was not subscribed false is returned
        Throws:
        RemoteException - If a network connection failure occurs.
      • hasListeners

        boolean hasListeners()
                      throws RemoteException
        Return whether the EventProducer has listeners.
        Returns:
        boolean; whether the EventProducer has listeners or not
        Throws:
        RemoteException - If a network connection failure occurs.
      • numberOfListeners

        int numberOfListeners​(EventTypeInterface eventType)
                       throws RemoteException
        Return the number of listeners for the provided EventTypeInterface.
        Parameters:
        eventType - EventTypeInterface; the event type to return the number of listeners for
        Returns:
        boolean; whether the EventProducer has listeners or not
        Throws:
        RemoteException - If a network connection failure occurs.
      • getEventTypesWithListeners

        Set<EventTypeInterface> getEventTypesWithListeners()
                                                    throws RemoteException
        Return the EventTypeInterfaces for which the EventProducer has listeners.
        Returns:
        Set<EventTypeInterface>; the EventTypeInterfaces for which the EventProducer has registered listeners
        Throws:
        RemoteException - If a network connection failure occurs.