public abstract class AbstractPersistenceEvent extends AbstractEvent implements TransactionAwareEvent, ClusterAwareEvent
| Constructor and Description |
|---|
AbstractPersistenceEvent() |
AbstractPersistenceEvent(java.io.Serializable pk) |
| Modifier and Type | Method and 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.
|
getScope, getSource, isFromCluster, setFromCluster, setScope, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanPublishpublic AbstractPersistenceEvent()
public AbstractPersistenceEvent(java.io.Serializable pk)
public java.lang.Object getId()
TransactionAwareEventgetId in interface TransactionAwareEventpublic boolean publishOnCommitOnly()
TransactionAwareEventpublishOnCommitOnly in interface TransactionAwareEventpublic boolean publish(int sourceNodeId,
int targetNodeId)
ClusterAwareEventreturn (sourceNodeId==targetNodeId ); => will only publish to local clusterreturn true; => will publish to all nodesreturn (targetNodeId==14); => publish to dedicated node regardless of sourcepublish in interface ClusterAwareEventtrue if event should be published from source cluster node to target cluster nodeCopyright © 2018 SAP SE. All Rights Reserved.