Index: topia2/src/java/org/codelutin/topia/TopiaContext.java diff -u topia2/src/java/org/codelutin/topia/TopiaContext.java:1.20 topia2/src/java/org/codelutin/topia/TopiaContext.java:1.21 --- topia2/src/java/org/codelutin/topia/TopiaContext.java:1.20 Wed Oct 18 08:44:22 2006 +++ topia2/src/java/org/codelutin/topia/TopiaContext.java Mon Oct 23 15:01:57 2006 @@ -23,9 +23,9 @@ * Created: 3 janv. 2006 21:18:34 * * @author poussin - * @version $Revision: 1.20 $ + * @version $Revision: 1.21 $ * - * Last update: $Date: 2006/10/18 08:44:22 $ + * Last update: $Date: 2006/10/23 15:01:57 $ * by : $Author: ruchaud $ */ @@ -37,10 +37,9 @@ import java.util.List; import org.codelutin.topia.event.TopiaEntityListener; -import org.codelutin.topia.event.TopiaEntityLoadListener; +import org.codelutin.topia.event.TopiaEntityVetoable; import org.codelutin.topia.event.TopiaTransactionListener; -import org.codelutin.topia.event.TopiaVetoableEntityListener; -import org.codelutin.topia.event.TopiaVetoableEntityLoadListener; +import org.codelutin.topia.event.TopiaTransactionVetoable; import org.codelutin.topia.persistence.TopiaEntity; /** @@ -50,101 +49,23 @@ public interface TopiaContext { - /** - * Permet d'ajouter un listener sur les fins de transaction d'un context - * @param l - */ - public void addTransactionListener(TopiaTransactionListener l); + /* Adders */ + public void addTopiaEntityListener(TopiaEntityListener listener); + public void addTopiaEntityListener(Class entityClass, TopiaEntityListener listener); + public void addTopiaEntityVetoable(TopiaEntityVetoable vetoable); + public void addTopiaEntityVetoable(Class entityClass, TopiaEntityVetoable vetoable); + public void addTopiaTransactionListener(TopiaTransactionListener listener); + public void addTopiaTransactionVetoable(TopiaTransactionVetoable vetoable); + + /* Removers */ + public void removeTopiaEntityListener(TopiaEntityListener listener); + public void removeTopiaEntityListener(Class entityClass, TopiaEntityListener listener); + public void removeTopiaEntityVetoable(TopiaEntityVetoable vetoable); + public void removeTopiaEntityVetoable(Class entityClass, TopiaEntityVetoable vetoable); + public void removeTopiaTransactionListener(TopiaTransactionListener listener); + public void removeTopiaTransactionVetoable(TopiaTransactionVetoable vetoable); /** - * Permet de supprimer un listener sur les fins de transaction d'un context - * @param l - */ - public void removeTransactionListener(TopiaTransactionListener l); - - /** - * Permet d'ajouter un vetoableListener qui pourra interdire certaines - * actions : creation, modification, suppression - * @param l le vetoableListener a ajouter - */ - public void addVetoableListener(TopiaVetoableEntityListener l); - - /** - * Enleve un vetoableListener qui peut empecher des actions - * @param l le vetoableListener a enlever - */ - public void removeVetoableListener(TopiaVetoableEntityListener l); - - /** - * Permet d'ajouter un vetoableLoadListener qui pourra interdire les actions - * de chargement - * @param l le vetoableLoadListener a ajouter - */ - public void addVetoableLoadListener(TopiaVetoableEntityLoadListener l); - - /** - * Enleve un vetoableLoadListener qui peut empecher des actions - * @param l le vetoableLoadListener a enlever - */ - public void removeVetoableLoadListener(TopiaVetoableEntityLoadListener l); - - /** - * Adds a new TopiaEntityListener to the subscribers list. - * @param topiaEntityListener - the TopiaEntityListener to add to the subscribers list. - */ - public void addTopiaEntityListener(TopiaEntityListener l); - - /** - * Adds a new TopiaEntityListener to the subscribers list. - * @param entityClass la classe de l'entity pour lequel on veut etre notifié - * les events des classes enfants nous parviennent aussi - * @param topiaEntityListener - the TopiaEntityListener to add to the subscribers list. - */ - public void addTopiaEntityListener(Class entityClass, TopiaEntityListener l); - - /** - * Removes a TopiaEntityListener from the subscribers list. - * @param topiaEntityListener - the TopiaEntityListener to remove from the subscribers. - */ - public void removeTopiaEntityListener(TopiaEntityListener l); - - /** - * Removes a TopiaEntityListener from the subscribers list. - * @param entityClass la classe de l'entity pour lequel on ne veut plus - * etre notifié. Si on n'etait pas listener de cette classe rien ne se passe - * @param topiaEntityListener - the TopiaEntityListener to remove from the subscribers. - */ - public void removeTopiaEntityListener(Class entityClass, TopiaEntityListener l); - - /** - * Adds a new TopiaEntityLoadListener to the subscribers list. - * @param topiaEntityLoadListener - the TopiaEntityLoadListener to add to the subscribers list. - */ - public void addTopiaEntityLoadListener(TopiaEntityLoadListener l); - - /** - * Adds a new TopiaEntityLoadListener to the subscribers list. - * @param entityClass la classe de l'entity pour lequel on veut etre notifié - * les events des classes enfants nous parviennent aussi - * @param topiaEntityLoadListener - the TopiaEntityLoadListener to add to the subscribers list. - */ - public void addTopiaEntityLoadListener(Class entityClass, TopiaEntityLoadListener l); - - /** - * Removes a TopiaEntityLoadListener from the subscribers list. - * @param topiaEntityLoadListener - the TopiaEntityLoadListener to remove from the subscribers. - */ - public void removeTopiaEntityLoadListener(TopiaEntityLoadListener l); - - /** - * Removes a TopiaEntityLoadListener from the subscribers list. - * @param entityClass la classe de l'entity pour lequel on ne veut plus - * etre notifié. Si on n'etait pas listener de cette classe rien ne se passe - * @param topiaEntityLoadListener - the TopiaEntityLoadListener to remove from the subscribers. - */ - public void removeTopiaEntityLoadListener(Class entityClass, TopiaEntityLoadListener l); - - /** * Permet de créer le schema de la base de données * @throws TopiaException */