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 Details

    • 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(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.
    • addListener

      void addListener(InvalidationListener listener)
      Invokes this method when an invalidation listener is being added.
      Parameters:
      listener - the invalidation listener object
      See Also:
    • removeListener

      void removeListener(InvalidationListener listener)
      Invokes this method when an invalidation listener is being removed.
      Parameters:
      listener - the invalidation listener object
      See Also:
    • addListener

      void addListener(ChangeListener listener)
      Invokes this method when a change listener is being added.
      Parameters:
      listener - the invalidation listener object
      See Also:
    • removeListener

      void removeListener(ChangeListener listener)
      Invokes this method when a change listener is being removed.
      Parameters:
      listener - the change listener object
      See Also:
    • addListener

      void addListener(PreInvalidationListener listener)
      Invokes this method when a pre-invalidation listener is being added.
      Parameters:
      listener - the pre-invalidation listener object
      See Also:
    • removeListener

      void removeListener(PreInvalidationListener listener)
      Invokes this method when a pre-invalidation listener is being removed.
      Parameters:
      listener - the pre-invalidation listener object
      See Also: