Class AbstractPersistenceEvent

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getId()
      Returns a unique id.
      boolean publish​(int sourceNodeId, int targetNodeId)
      Decide whether this event should be broadcasted/received.
      boolean publishOnCommitOnly()
      Decide whether this event should be broadcasted/received delayed on commit or directly this is useful if you want to publish custom event depending on the success of a running transaction if no transaction is running, the event is being sent immediately.
      • Methods inherited from class org.springframework.context.ApplicationEvent

        getTimestamp
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AbstractPersistenceEvent

        public AbstractPersistenceEvent()
      • AbstractPersistenceEvent

        public AbstractPersistenceEvent​(java.io.Serializable pk)
    • Method Detail

      • getId

        public java.lang.Object getId()
        Description copied from interface: TransactionAwareEvent
        Returns a unique id. Two events with the same id in the same transaction will not get published twice.
        Specified by:
        getId in interface TransactionAwareEvent
        Returns:
        the id
      • publishOnCommitOnly

        public boolean publishOnCommitOnly()
        Description copied from interface: TransactionAwareEvent
        Decide whether this event should be broadcasted/received delayed on commit or directly this is useful if you want to publish custom event depending on the success of a running transaction if no transaction is running, the event is being sent immediately.
        Specified by:
        publishOnCommitOnly in interface TransactionAwareEvent
      • publish

        public boolean publish​(int sourceNodeId,
                               int targetNodeId)
        Description copied from interface: ClusterAwareEvent
        Decide whether this event should be broadcasted/received. Examples are
        • return (sourceNodeId==targetNodeId ); => will only publish to local cluster
        • return true; => will publish to all nodes
        • return (targetNodeId==14); => publish to dedicated node regardless of source
        Specified by:
        publish in interface ClusterAwareEvent
        Returns:
        true if event should be published from source cluster node to target cluster node