org.ioc.commons.integration.dataaccess.dao.SubscriptionChangeHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons Show documentation
Show all versions of ioc-commons Show documentation
This project defines a set of useful java interfaces for helping you in the definition of the structure of your developments in Java-projects which are designed using a Inversion-Of-Control (IOC) pattern. Useful for MVP-Pattern designs in applications coded on GWT, SWT, Android, etc.
package org.ioc.commons.integration.dataaccess.dao;
/**
* Handler for a subscripted change performed on an entity
*
* @author Jesús Lunar Pérez
*
* @param
*/
public interface SubscriptionChangeHandler {
/**
* Type of subscriptable changes on an entity
*
* @author Jesús Lunar Pérez
*
*/
public enum ChangeType {
/**
* Notifies when an entity has been persisted
*/
PERSISTED,
/**
* Notifies when an entity has been updated
*/
UPDATED,
/**
* Notifies when an entity has been deleted
*/
DELETED
}
/**
* Method which will be called when a subscribed change has occurred.
*
* @param sender
* Sender for the change
* @param id
* Unique identifier of the entity which has been changed.
* @param changeType
* Type of change occurred.
*/
void handleSubscription(Object sender, I id, ChangeType changeType);
}