Index: topia/src/java/org/codelutin/topia/distribution/LocalDistributionHelper.java diff -u /dev/null topia/src/java/org/codelutin/topia/distribution/LocalDistributionHelper.java:1.1 --- /dev/null Fri Jul 30 14:39:04 2004 +++ topia/src/java/org/codelutin/topia/distribution/LocalDistributionHelper.java Fri Jul 30 14:38:59 2004 @@ -0,0 +1,61 @@ +/* *##% + * 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. + *##%*/ + +/* * + * LocalDistributionHelper.java + * + * Created: 14 juil. 2004 + * + * @author Benjamin Poussin + * Copyright Code Lutin + * @version $Revision: 1.1 $ + * + * Mise a jour: $Date: 2004/07/30 14:38:59 $ + * par : $Author: pineau $ + */ + +package org.codelutin.topia.distribution; + +import java.util.Properties; +import org.codelutin.topia.TopiaContext; +import org.codelutin.topia.TopiaException; +import org.codelutin.topia.TopiaArgument; +import java.beans.Expression; + +public class LocalDistributionHelper implements DistributionHelper { // LocalDistributionHelper + + TopiaContext context = null; + Properties properties = null; + + public LocalDistributionHelper(TopiaContext context, Properties properties){ + this.context = context; + this.properties = properties; + } + + public Object call(Class service, String methodName, TopiaArgument args) throws TopiaException{ + Object serviceImpl = context.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); + } + } + +} // LocalDistributionHelper +