1 /** 2 * Copyright (C) 2002 Kelua SA 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 */ 18 19 package org.objectweb.kilim.model; 20 21 import org.objectweb.kilim.KilimException; 22 23 /** 24 * @author horn 25 */ 26 27 public interface ComponentSource extends ComponentElement { 28 /** 29 * This method has a behaviour that depends on the exact nature of the value source. 30 * In case of properties, it simply returns the property value associated to it. 31 * In case of providers, it (re)executes the corresponding method, constructor, getter, ..... and returns the (new) obtained result. 32 * In case of unary ports two cases should be distinguished : 1) getValue() has not been previously invoked and no value is thus associated to the source. 33 * getValue() then results in the execution of the corresponding method, constructor, getter, ...... The obtained result is stored and returned after execution 34 * of the "bind" triggers.. 2) getValue() has been previously invoked. The stored result is returned. 35 * @return Object : the reference of the object provided by the source. 36 * @throws KilimException : the exception is generated when the method is invoked on unbound references or nary ports. 37 */ 38 Object getValue() throws KilimException; 39 40 /** 41 * returns whether a value has been evaluated and stored in the source. The behaviour of this method is 42 * highly dependant on the real nature of the source. It always returns false when invoked on a provider. 43 * @return boolean 44 * @throws KilimException : the exception is generated when the method is invoked on unbound references or nary ports. 45 */ 46 boolean hasValue() throws KilimException; 47 }