Interface IEventManager


public interface IEventManager
Manager of listeners interested in the persistence events.

See the related IPersistenceEvent and IPersistenceListener for more information.

Using the com.polarion.platform.persistence.dataservice.listeners configuration point the listeners might register during startup, to make sure not to miss any event. The contribution looks like this:

  <contribution configuration-id="com.polarion.platform.persistence.dataservice.listeners">
      <listener
          service="my-service-implementing-IPersistenceEventListener"
          contextId="/repository-name/projectId"    (optional)
          prototypes="Comma,Separated,List"    (optional)
      />
  </contribution>
 
Author:
dobisekm
  • Method Details

    • registerListener

      void registerListener(IPersistenceListener l)
      Registers the listener for all events.
      Parameters:
      l - Not null.
    • registerListener

      void registerListener(IPersistenceListener l, String[] prototypes)
      Registers the listener only for evens on objects of given prototypes.
      Parameters:
      l - Not null.
      prototypes - Prototypes, if null, then no filtering will occur.
    • registerListener

      void registerListener(IPersistenceListener l, IContextId context)
      Registers the listener only for evens on objects from given contex.

      Note, that this method does not take into account the context hierarchy, and therefore the events from the child contexts of the given context will not be processed.

      Parameters:
      l - Not null.
      context - The context, if null, then no filtering will occur.
    • registerListener

      void registerListener(IPersistenceListener l, String[] prototypes, IContextId context)
      Registers the listener only for evens on objects of given prototypes from given context.

      Note, that this method does not take into account the context hierarchy, and therefore the events from the child contexts of the given context will not be processed.

      Parameters:
      l - Not null. If the listener is already registered, then it's deregistered and registered with the new settings.
      prototypes - Prototypes, if null, then no filtering will occur.
      context - The context, if null, then no filtering will occur.
    • registerListener

      void registerListener(IPersistenceListener l, String[] prototypes, IContextId context, boolean singleNode)
      Registers the listener only for events on objects of given prototypes from given context.

      Note, that this method does not take into account the context hierarchy, and therefore the events from the child contexts of the given context will not be processed.

      Parameters:
      l - Not null. If the listener is already registered, then it's deregistered and registered with the new settings.
      prototypes - Prototypes, if null, then no filtering will occur.
      context - The context, if null, then no filtering will occur.
      singleNode - If the listener should be run on single node in cluster if node is running in cluster WARNING: experimental - may not work for some prototypes
      Since:
      3.8.0
    • deregisterListener

      void deregisterListener(IPersistenceListener l)
      Completely deregister the listener.
      Parameters:
      l - Not null.