|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanPersistListener<T>
Listens for committed bean events.
These listen events occur after a successful commit. They also occur in a background thread rather than the thread used to perform the actual insert update or delete. In this way there is a delay between the commit and when the listener is notified of the event.
For a cluster these events may need to be broadcast. Each of the inserted(), updated() and deleted() methods return true if you want those events to be broadcast to the other members of a cluster (the id values are broadcast). If these methods return false then the events are not broadcast.
It is worth noting that BeanPersistListener is different in three main ways from BeanPersistController postXXX methods.
A BeanPersistListener is either found automatically via class path search or can be added programmatically via ServerConfiguration.addEntity().
Method Summary | |
---|---|
boolean |
deleted(T bean)
Notified that a bean has been deleted locally. |
boolean |
inserted(T bean)
Notified that a bean has been inserted locally. |
void |
remoteDelete(Object id)
Notify that a bean was deleted on another node of the cluster. |
void |
remoteInsert(Object id)
Notify that a bean was inserted on another node of the cluster. |
void |
remoteUpdate(Object id)
Notify that a bean was updated on another node of the cluster. |
boolean |
updated(T bean,
Set<String> updatedProperties)
Notified that a bean has been updated locally. |
Method Detail |
---|
boolean inserted(T bean)
bean
- The bean that was inserted.boolean updated(T bean, Set<String> updatedProperties)
bean
- The bean that was updated.updatedProperties
- the properties on the bean that where updatedboolean deleted(T bean)
bean
- The bean that was deleted.void remoteInsert(Object id)
id
- the id value of the inserted beanvoid remoteUpdate(Object id)
id
- the id value of the updated bean.void remoteDelete(Object id)
id
- the id value of the deleted bean.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |