Author: chatellier Date: 2009-01-09 09:01:36 +0000 (Fri, 09 Jan 2009) New Revision: 1290 Added: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/TopiaApplicationServiceMetaGenerator.java Modified: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceImplGenerator.java Log: Ajout d'un meta generateur pour les 3 generateurs des services Modified: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceImplGenerator.java =================================================================== --- topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceImplGenerator.java 2009-01-07 08:49:38 UTC (rev 1289) +++ topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceImplGenerator.java 2009-01-09 09:01:36 UTC (rev 1290) @@ -20,9 +20,7 @@ import java.io.File; import java.io.IOException; import java.io.Writer; -import java.util.Collection; import java.util.Iterator; -import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -31,8 +29,6 @@ import org.codelutin.generator.models.object.ObjectModelClass; import org.codelutin.generator.models.object.ObjectModelClassifier; import org.codelutin.generator.models.object.ObjectModelInterface; -import org.codelutin.generator.models.object.ObjectModelOperation; -import org.codelutin.generator.models.object.ObjectModelParameter; import org.codelutin.topia.service.TopiaApplicationServiceAbstract; /** Added: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/TopiaApplicationServiceMetaGenerator.java =================================================================== --- topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/TopiaApplicationServiceMetaGenerator.java (rev 0) +++ topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/TopiaApplicationServiceMetaGenerator.java 2009-01-09 09:01:36 UTC (rev 1290) @@ -0,0 +1,80 @@ +/* *##% ToPIA - Tools for Portable and Independent Architecture + * Copyright (C) 2004 - 2008 CodeLutin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 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 Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/ + +package org.codelutin.topia.generator; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.codelutin.generator.ObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModel; + +import java.io.File; +import java.io.IOException; + +/** + * Meta generateur des services. + */ +public class TopiaApplicationServiceMetaGenerator extends ObjectModelGenerator { + + /** logger */ + protected static Log log = LogFactory.getLog(TopiaApplicationServiceMetaGenerator.class); + + /* + * @see org.codelutin.generator.ObjectModelGenerator#generate(org.codelutin.generator.models.object.ObjectModel, java.io.File) + */ + @Override + public void generate(ObjectModel model, File destDir) throws IOException { + + generateApplicationService(model, destDir); + + } + + /** + * Appel les autres generateu des services. + * + * @param model + * @param destDir + * @throws IOException + */ + public void generateApplicationService(ObjectModel model, File destDir) + throws IOException { + + ObjectModelGenerator gen = null; + + // Genere les interfaces des services + if(log.isInfoEnabled()) { + log.info("Generating Service Interface"); + } + gen = new ServiceInterfaceGenerator(this); + gen.generate(model, destDir); + + // Genere les abstract des services + if(log.isInfoEnabled()) { + log.info("Generating Service Abstract"); + } + gen = new ServiceAbstractGenerator(this); + gen.generate(model, destDir); + + // Genere les impl des services + if(log.isInfoEnabled()) { + log.info("Generating Service Impl"); + } + gen = new ServiceImplGenerator(this); + gen.generate(model, destDir); + } + +} //TopiaApplicationServiceMetaGenerator