Index: topia2/src/java/org/codelutin/topia/service/TopiaServiceProvider.java diff -u topia2/src/java/org/codelutin/topia/service/TopiaServiceProvider.java:1.1 topia2/src/java/org/codelutin/topia/service/TopiaServiceProvider.java:1.2 --- topia2/src/java/org/codelutin/topia/service/TopiaServiceProvider.java:1.1 Wed Apr 18 12:21:24 2007 +++ topia2/src/java/org/codelutin/topia/service/TopiaServiceProvider.java Tue Jul 24 14:02:00 2007 @@ -36,9 +36,9 @@ * TopiaServiceProvider.java * * @author chatellier - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * - * Last update : $Date: 2007/04/18 12:21:24 $ By : $Author: chatellier $ + * Last update : $Date: 2007/07/24 14:02:00 $ By : $Author: chatellier $ */ public class TopiaServiceProvider { @@ -60,7 +60,7 @@ /** * Sert a savoir si des servers ont deja ete lance ou pas. */ - private Map mapDispatcherForProtocole; + private Map mapDispatcherForProtocole; /** * Constructeur @@ -69,7 +69,7 @@ // instancaition des maps mapInstanceForClass = new HashMap, TopiaApplicationService>(); mapClassForClass = new HashMap, Class>(); - mapDispatcherForProtocole = new HashMap(); + mapDispatcherForProtocole = new HashMap(); } /** @@ -80,7 +80,7 @@ */ public void addServiceClass( Class interfaze, - Class clazz, Protocole protocole) { + Class clazz, Protocol protocole) { TopiaServiceServer server = initDispatcher(protocole); if (server != null) { server.addService(interfaze); @@ -97,7 +97,7 @@ */ public void addServiceInstance( Class interfaze, - TopiaApplicationService instance, Protocole protocole) { + TopiaApplicationService instance, Protocol protocole) { TopiaServiceServer server = initDispatcher(protocole); if (server != null) { server.addService(interfaze); @@ -111,7 +111,7 @@ * * @param protocole */ - private TopiaServiceServer initDispatcher(Protocole protocole) { + private TopiaServiceServer initDispatcher(Protocol protocole) { TopiaServiceServer server = mapDispatcherForProtocole.get(protocole); @@ -150,7 +150,7 @@ * * @param protocole */ - private void launchDispatcher(Protocole protocole) { + private void launchDispatcher(Protocol protocole) { TopiaServiceServer server = mapDispatcherForProtocole.get(protocole); /*switch (protocole) { Index: topia2/src/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java diff -u topia2/src/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java:1.1 topia2/src/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java:1.2 --- topia2/src/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java:1.1 Fri May 25 16:11:04 2007 +++ topia2/src/java/org/codelutin/topia/service/TopiaApplicationServiceFactory.java Tue Jul 24 14:02:00 2007 @@ -52,9 +52,9 @@ * Sert aussi au serveur pour declarer des services * * @author chatellier - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * - * Last update : $Date: 2007/05/25 16:11:04 $ By : $Author: ndupont $ + * Last update : $Date: 2007/07/24 14:02:00 $ By : $Author: chatellier $ */ public class TopiaApplicationServiceFactory { @@ -135,7 +135,7 @@ Set keySet = config.keySet(); for (Object key : keySet) { - if (key.toString().startsWith(TOPIA_APPLICATION_SERVICE_BEGIN)) { + if (key.toString().startsWith(TOPIA_APPLICATION_PROVIDE_BEGIN)) { // convertir l'URI pour recuperer les parametres String serviceUrl = config.getProperty(key.toString()); @@ -149,12 +149,12 @@ String host = uriService.getHost(); String fragment = uriService.getFragment(); String serviceClassName = ((String) key).replace( - TOPIA_APPLICATION_SERVICE_BEGIN, ""); - Protocole protocole = null; + TOPIA_APPLICATION_PROVIDE_BEGIN, ""); + Protocol protocole = null; // instancier puis lancer le service if (!proto.equalsIgnoreCase("local")) { - protocole = Protocole.valueOf(proto.replace('-', '_') + protocole = Protocol.valueOf(proto.replace('-', '_') .toUpperCase()); Class serviceInterface = null; Class serviceImplement = null; @@ -317,7 +317,7 @@ * l'URI * * @param uriService - * @return l'implementation ou null si le protocol n'est pas géré + * @return l'implementation ou null si le protocol n'est pas g�r� */ private static TopiaProxy getProxyForURI(URI uriService) { @@ -351,11 +351,11 @@ public static void addService( Class interfaze, Class clazz, - Protocole... protocoles) { + Protocol... protocoles) { log.debug("Adding service for '" + interfaze + "' in protocoles : " + Arrays.toString(protocoles)); - for (Protocole protocole : protocoles) { + for (Protocol protocole : protocoles) { mainDispatcher.addServiceClass(interfaze, clazz, protocole); } } @@ -377,12 +377,12 @@ * @see TopiaApplicationService */ public static void addService( - Class interfaze, E instance, Protocole... protocoles) { + Class interfaze, E instance, Protocol... protocoles) { log.debug("Adding service for '" + interfaze + "'(unique instance) in protocoles : " + Arrays.toString(protocoles)); - for (Protocole protocole : protocoles) { + for (Protocol protocole : protocoles) { mainDispatcher.addServiceInstance(interfaze, instance, protocole); } } Index: topia2/src/java/org/codelutin/topia/service/Protocol.java diff -u /dev/null topia2/src/java/org/codelutin/topia/service/Protocol.java:1.1 --- /dev/null Tue Jul 24 14:02:05 2007 +++ topia2/src/java/org/codelutin/topia/service/Protocol.java Tue Jul 24 14:02:00 2007 @@ -0,0 +1,38 @@ +/* *##% + * Copyright (C) 2006 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package org.codelutin.topia.service; + +/** + * Protocole. + * + * Liste des protocoles de web services supportes + * + * @author chatellier + * @version $Revision: 1.1 $ + * + * Last update : $Date: 2007/07/24 14:02:00 $ By : $Author: chatellier $ + */ +public enum Protocol { + /** RMI */ + RMI, + /** XML-RPC */ + XML_RPC, + /** SOAP */ + SOAP +}