Interface EventSource


  • public interface EventSource
    Runtime objects implement this when they are an event source Java objects can be registered with an EventSource. The listeners are called when the fireEvent, cacheEntryChanged, or shouldInvalidate methods is called.

    Here are the functions for the interface:

    • To add invalidation, pre-invalidation and change listeners.
    • To remove invalidation, pre-invalidation and change listeners.
    • To fire invalidation, pre-invalidation and change events.
    • To find how many listeners registered.
    Since:
    WAS7.0
    • Method Detail

      • getInvalidationListenerCount

        int getInvalidationListenerCount()
        Returns number of invalidation listeners registered.
        Returns:
        invalidation listener count
      • getPreInvalidationListenerCount

        int getPreInvalidationListenerCount()
        Returns number of pre-invalidation listener registered. It should be 0 or 1.
        Returns:
        pre-invalidation listener count
      • getChangeListenerCount

        int getChangeListenerCount()
        Returns mumber of change listeners registered.
        Returns:
        change listener count
      • fireEvent

        void fireEvent​(InvalidationEvent event)
        Invokes this method when the invalidation event is being fired.
      • shouldInvalidate

        boolean shouldInvalidate​(java.lang.Object id,
                                 int source,
                                 int cause)
        Invokes this method prior to the invalidation event occuring and is used to provide a callback that allows the listener to approve/deny an invalidation from occuring.
      • cacheEntryChanged

        void cacheEntryChanged​(ChangeEvent event)
        Invokes this method when the change event is being fired.