Author: bpoussin Date: 2010-06-01 15:39:30 +0200 (Tue, 01 Jun 2010) New Revision: 55 Url: http://chorem.org/repositories/revision/bow/55 Log: ajout d'un proxy specifique bow (il faut modifier le pom pour prendre la prochaine release wikitty qui ne devrait pas tarder) Added: trunk/src/main/java/org/chorem/bow/BowProxy.java Added: trunk/src/main/java/org/chorem/bow/BowProxy.java =================================================================== --- trunk/src/main/java/org/chorem/bow/BowProxy.java (rev 0) +++ trunk/src/main/java/org/chorem/bow/BowProxy.java 2010-06-01 13:39:30 UTC (rev 55) @@ -0,0 +1,60 @@ +/* *##% + * Copyright (c) 2010 poussin. All rights reserved. + * + * 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 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 Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + *##%*/ + +package org.chorem.bow; + + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.wikitty.WikittyProxy; +import org.nuiton.wikitty.WikittyService; +//import org.nuiton.wikitty.WikittyServiceCached; +import org.nuiton.wikitty.jdbc.WikittyServiceJDBC; + +/** + * Proxy pour utiliser les wikitty convenablement initialise. + * + * @author poussin + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ + */ +public class BowProxy extends WikittyProxy { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(BowProxy.class); + + static protected BowProxy instance; + + synchronized static public BowProxy getInstance() { + if (instance == null) { + BowConfig config = BowConfig.getInstance(); + instance = new BowProxy(config); + } + return instance; + } + + protected BowProxy(BowConfig config) { + WikittyService ws = new WikittyServiceJDBC(config.getFlatOptions()); + // FIXME activate next line, when new wikitty version released ans tested +// ws = new WikittyServiceCached(ws); + setWikittyService(ws); + } + + +}