Index: topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java diff -u topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java:1.36 topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java:1.37 --- topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java:1.36 Mon Oct 9 14:20:18 2006 +++ topia2/src/java/org/codelutin/topia/framework/TopiaContextImpl.java Fri Oct 13 12:20:00 2006 @@ -23,9 +23,9 @@ * * @author poussin * - * @version $Revision: 1.36 $ + * @version $Revision: 1.37 $ * - * Last update: $Date: 2006/10/09 14:20:18 $ by : $Author: bpoussin $ + * Last update: $Date: 2006/10/13 12:20:00 $ by : $Author: bpoussin $ */ package org.codelutin.topia.framework; @@ -43,7 +43,6 @@ import java.io.PrintStream; import java.io.Reader; import java.io.Writer; -import java.lang.reflect.Constructor; import java.sql.Connection; import java.sql.Statement; import java.text.DateFormat; @@ -62,6 +61,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.codelutin.topia.IndexEnginService; import org.codelutin.topia.TopiaContext; import org.codelutin.topia.TopiaException; import org.codelutin.topia.TopiaNotFoundException; @@ -77,6 +77,7 @@ import org.codelutin.topia.event.TopiaVetoableEntityListener; import org.codelutin.topia.event.TopiaVetoableEntityLoadEvent; import org.codelutin.topia.event.TopiaVetoableEntityLoadListener; +import org.codelutin.topia.index.IndexEnginImplementor; import org.codelutin.topia.persistence.TopiaDAO; import org.codelutin.topia.persistence.TopiaDAODelegator; import org.codelutin.topia.persistence.TopiaEntity; @@ -208,7 +209,7 @@ protected List transactionEvents = new LinkedList(); - protected IndexEngin indexEngin = null; + protected IndexEnginImplementor indexEngin = null; /** * Manager pour la sécurité @@ -1163,7 +1164,7 @@ getParentContext().fireOnCommited(); } if (isIndexEnabled()) { - getIndexEngin().indexMap(); + getIndexEnginImplementor().doIndexation(); } } catch (Exception eee) { if (log.isWarnEnabled()) { @@ -1172,7 +1173,7 @@ } finally { transactionEvents.clear(); if (isIndexEnabled()) { - getIndexEngin().clearIndexMap(); + getIndexEnginImplementor().clearLastRecordedIndexation(); } } } @@ -1200,7 +1201,7 @@ } finally { transactionEvents.clear(); if (isIndexEnabled()) { - getIndexEngin().clearIndexMap(); + getIndexEnginImplementor().clearLastRecordedIndexation(); } } } @@ -1336,7 +1337,7 @@ context.fireOnUpdated(event.getPersister().getMappedClass( EntityMode.POJO), id, event.getEntity()); if (context.isIndexEnabled()) { - context.getIndexEngin().addForIndexation(id, event.getState()); + context.getIndexEnginImplementor().recordForIndexation(id, event.getState()); } } } @@ -1354,7 +1355,7 @@ context.fireOnDeleted(event.getPersister().getMappedClass( EntityMode.POJO), id, event.getEntity()); if (context.isIndexEnabled()) { - context.getIndexEngin().addForIndexation(id, null); + context.getIndexEnginImplementor().recordForIndexation(id, null); } } } @@ -1373,7 +1374,7 @@ try { Class forName = Class.forName(classIndexEngin); Object newInstance = forName.newInstance(); - indexEngin = (IndexEngin) newInstance; + indexEngin = (IndexEnginImplementor) newInstance; indexEngin.init(this); } catch (Throwable eee) { if(log.isErrorEnabled()) { @@ -1390,10 +1391,15 @@ return getIndexEngin() != null; } - public IndexEngin getIndexEngin() { + public IndexEnginService getIndexEngin() { + IndexEnginService result = getIndexEnginImplementor(); + return result; + } + + public IndexEnginImplementor getIndexEnginImplementor() { TopiaContextImplementor parent = getParentContext(); if(parent != null) { - return parent.getIndexEngin(); + return parent.getIndexEnginImplementor(); } else { return indexEngin; } Index: topia2/src/java/org/codelutin/topia/framework/TopiaContextImplementor.java diff -u topia2/src/java/org/codelutin/topia/framework/TopiaContextImplementor.java:1.11 topia2/src/java/org/codelutin/topia/framework/TopiaContextImplementor.java:1.12 --- topia2/src/java/org/codelutin/topia/framework/TopiaContextImplementor.java:1.11 Mon Oct 9 14:20:18 2006 +++ topia2/src/java/org/codelutin/topia/framework/TopiaContextImplementor.java Fri Oct 13 12:20:00 2006 @@ -23,9 +23,9 @@ * Created: 3 janv. 2006 21:27:24 * * @author poussin - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ * - * Last update: $Date: 2006/10/09 14:20:18 $ + * Last update: $Date: 2006/10/13 12:20:00 $ * by : $Author: bpoussin $ */ @@ -34,9 +34,11 @@ import java.util.Properties; import java.util.Set; +import org.codelutin.topia.IndexEnginService; import org.codelutin.topia.TopiaContext; import org.codelutin.topia.TopiaException; import org.codelutin.topia.TopiaNotFoundException; +import org.codelutin.topia.index.IndexEnginImplementor; import org.codelutin.topia.persistence.TopiaDAO; import org.codelutin.topia.persistence.TopiaEntity; import org.codelutin.util.CategorisedListenerSet; @@ -204,6 +206,11 @@ */ public boolean isSecurityEnabled(); + /** + * Retourne la vision framework du moteur d'indexation + */ + public IndexEnginImplementor getIndexEnginImplementor(); + public void removeChildContext(TopiaContextImplementor child); } //TopiaContextImplementor