Index: topia/src/java/org/codelutin/topia/AbstractTopiaPersistenceService.java diff -u topia/src/java/org/codelutin/topia/AbstractTopiaPersistenceService.java:1.4 topia/src/java/org/codelutin/topia/AbstractTopiaPersistenceService.java:1.5 --- topia/src/java/org/codelutin/topia/AbstractTopiaPersistenceService.java:1.4 Thu Jul 15 13:13:12 2004 +++ topia/src/java/org/codelutin/topia/AbstractTopiaPersistenceService.java Sun Aug 15 13:44:10 2004 @@ -23,26 +23,18 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * - * Mise a jour: $Date: 2004/07/15 13:13:12 $ - * par : $Author: bpoussin $ + * Mise a jour: $Date: 2004/08/15 13:44:10 $ + * par : $Author: pineau $ */ package org.codelutin.topia; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; import java.util.List; -import org.codelutin.util.ListenerSet; - public abstract class AbstractTopiaPersistenceService extends AbstractTopiaService implements TopiaPersistenceService { // AbstractTopiaPersistenceService - ListenerSet listeners = new ListenerSet(); - /** * Adds a new TopiaEntityListener to the subscribers list. * @param topiaEntityListener - the TopiaEntityListener to add to the @@ -73,13 +65,34 @@ } public TopiaEntity makePersistent(TopiaEntity topiaEntity)throws TopiaException{ - return getContext().getPersistenceHelper().makePersistent(topiaEntity); + TopiaEntity result = getContext().getPersistenceHelper().makePersistent(topiaEntity); + try { + getContext().getListeners().fire(this, "entityAdded", new TopiaEntityEvent(this, result)); + } catch (Exception e) { + e.printStackTrace(); + // No trace that would pollute logs + } + return result; } public TopiaEntity update(TopiaEntity topiaEntity) throws TopiaException{ - return getContext().getPersistenceHelper().update(topiaEntity); + TopiaEntity result = getContext().getPersistenceHelper().update(topiaEntity); + try { + getContext().getListeners().fire(this, "entityModified", new TopiaEntityEvent(this, result)); + } catch (Exception e) { + e.printStackTrace(); + // No trace that would pollute logs + } + return result; } public void delete(TopiaEntity topiaEntity) throws TopiaException{ - getContext().getPersistenceHelper().delete(topiaEntity); + TopiaEntity result = getContext().getPersistenceHelper().delete(topiaEntity); + try { + getContext().getListeners().fire(this, "entityRemoved", new TopiaEntityEvent(this, result)); + } catch (Exception e) { + e.printStackTrace(); + // No trace that would pollute logs + } + return result; } /**