Index: topia/src/java/org/codelutin/topia/distribution/LocalDistributionHelper.java diff -u topia/src/java/org/codelutin/topia/distribution/LocalDistributionHelper.java:1.1 topia/src/java/org/codelutin/topia/distribution/LocalDistributionHelper.java:1.2 --- topia/src/java/org/codelutin/topia/distribution/LocalDistributionHelper.java:1.1 Fri Jul 30 14:38:59 2004 +++ topia/src/java/org/codelutin/topia/distribution/LocalDistributionHelper.java Fri Jul 30 16:57:58 2004 @@ -23,9 +23,9 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * - * Mise a jour: $Date: 2004/07/30 14:38:59 $ + * Mise a jour: $Date: 2004/07/30 16:57:58 $ * par : $Author: pineau $ */ @@ -37,23 +37,23 @@ import org.codelutin.topia.TopiaArgument; import java.beans.Expression; -public class LocalDistributionHelper implements DistributionHelper { // LocalDistributionHelper - - TopiaContext context = null; - Properties properties = null; +public class LocalDistributionHelper extends AbstractDistributionHelper { // LocalDistributionHelper + /** + * @param context + * @param properties + */ public LocalDistributionHelper(TopiaContext context, Properties properties){ - this.context = context; - this.properties = properties; + super(context, properties); } public Object call(Class service, String methodName, TopiaArgument args) throws TopiaException{ - Object serviceImpl = context.getService(service, true); + Object serviceImpl = getContext().getService(service, true); Expression result = new Expression(serviceImpl, methodName, args.getArgs().toArray()); try{ return result.getValue(); }catch(Exception eee){ - throw new TopiaException("Can't call local methode", eee); + throw new TopiaException("Can't call local method", eee); } } Index: topia/src/java/org/codelutin/topia/distribution/AbstractDistributionHelper.java diff -u /dev/null topia/src/java/org/codelutin/topia/distribution/AbstractDistributionHelper.java:1.1 --- /dev/null Fri Jul 30 16:58:03 2004 +++ topia/src/java/org/codelutin/topia/distribution/AbstractDistributionHelper.java Fri Jul 30 16:57:58 2004 @@ -0,0 +1,67 @@ +/* *##% + * Copyright (C) 2002, 2003 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. + *##%*/ + +/* * + * AbstractDistributionHelper.java + * + * Created: 3 juil. 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2004/07/30 16:57:58 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.distribution; + +import java.util.Properties; + +import org.codelutin.topia.TopiaArgument; +import org.codelutin.topia.TopiaContext; +import org.codelutin.topia.TopiaException; + +public abstract class AbstractDistributionHelper { // AbstractDistributionHelper + + /** + * Le context a partir duquel on a recupere ce AbstractPersistenceHelper + */ + protected TopiaContext context = null; + + /** + * Les proprietes pour ce AbstractPersistenceHelper + */ + protected Properties properties = null; + + public TopiaContext getContext(){ + return context; + } + + public Properties getProperties(){ + return properties; + } + + public AbstractDistributionHelper(TopiaContext context, Properties properties) { + this.context = context; + } + + public abstract Object call(Class service, String methodName, TopiaArgument args) throws TopiaException; + +} // AbstractDistributionHelper + Index: topia/src/java/org/codelutin/topia/distribution/JndiDistributionHelper.java diff -u /dev/null topia/src/java/org/codelutin/topia/distribution/JndiDistributionHelper.java:1.1 --- /dev/null Fri Jul 30 16:58:03 2004 +++ topia/src/java/org/codelutin/topia/distribution/JndiDistributionHelper.java Fri Jul 30 16:57:58 2004 @@ -0,0 +1,58 @@ +/* *##% + * Copyright (C) 2002, 2003, 2004 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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. + *##%*/ + +/* * + * JndiDistributionHelper.java + * + * Created: Jul 30, 2004 + * + * @author Cédric Pineau + * @version $Revision: 1.1 $ + * + * Last update : $Date: 2004/07/30 16:57:58 $ + * by : $Author: pineau $ + */ + +package org.codelutin.topia.distribution; + +import java.util.Properties; + +import org.codelutin.topia.TopiaArgument; +import org.codelutin.topia.TopiaContext; +import org.codelutin.topia.TopiaException; + +/** + * + */ +public class JndiDistributionHelper extends AbstractDistributionHelper { + + /** + * @param context + * @param properties + */ + public JndiDistributionHelper(TopiaContext context, Properties properties) { + super(context, properties); + } + + public Object call(Class service, String methodName, TopiaArgument args) throws TopiaException { + return null; + } + + +}