Index: topia/src/java/org/codelutin/topia/TopiaContext.java diff -u topia/src/java/org/codelutin/topia/TopiaContext.java:1.25 topia/src/java/org/codelutin/topia/TopiaContext.java:1.26 --- topia/src/java/org/codelutin/topia/TopiaContext.java:1.25 Wed Jun 16 09:41:26 2004 +++ topia/src/java/org/codelutin/topia/TopiaContext.java Mon Jul 5 10:48:41 2004 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.25 $ + * @version $Revision: 1.26 $ * - * Mise a jour: $Date: 2004/06/16 09:41:26 $ - * par : $Author: bpoussin $ + * Mise a jour: $Date: 2004/07/05 10:48:41 $ + * par : $Author: pineau $ */ package org.codelutin.topia; @@ -69,18 +69,18 @@ protected TopiaPersistenceHelper persistenceHelper = null; protected Cache cache = new Cache(); - public static TopiaContext getContext() throws TopiaException { - return getContext(((Properties)null)); + public static TopiaContext instantiateContext() throws TopiaException { + return instantiateContext(((Properties)null)); } - public static TopiaContext getContext(String propertiesFileName) throws TopiaException { + public static TopiaContext instantiateContext(String propertiesFileName) throws TopiaException { if (propertiesFileName == null) { - return getContext(((Properties)null)); + return instantiateContext(((Properties)null)); } - return getContext(getProperties(propertiesFileName)); + return instantiateContext(getProperties(propertiesFileName)); } - public static TopiaContext getContext(Properties properties) + public static TopiaContext instantiateContext(Properties properties) throws TopiaException { TopiaContext context = (TopiaContext) contexts.get(properties); if (context == null) { @@ -418,7 +418,11 @@ * @return le nom de la classe a souhaitée, null si pas de classe trouvé */ public String getInterfaceName(String category, Class clazz) { - return getProperty("mapping."+category+".interface."+clazz.getName()); + String result =getProperty("mapping."+category+".interface."+clazz.getName()); + if (result == null) { + throw new RuntimeException("Can't find mapping for "+category+".interface."+clazz.getName()); + } + return result; } public String getPersistenceHelperClassName(){