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 java.util.Stack; 22 23 import org.objectweb.kilim.KilimException; 24 25 /** 26 * @author horn 27 */ 28 29 public interface RuntimeSource extends RuntimeElement { 30 /** 31 * Method getValue. 32 * @return Object : the reference of the object provided by the source. 33 * @throws KilimException : the exception is generated when the method is invoked on unbound references 34 * or on illegal elements. 35 */ 36 Object getValue() throws KilimException; 37 38 /** 39 * returns whether the source has a value. The behaviour depends on the nature of the source. 40 * It always returns false when invoked on tagged providers, for example. 41 * @return boolean 42 * @throws KilimException : 43 */ 44 boolean hasValue() throws KilimException; 45 46 /** 47 * returns whether a value can be obtained without having to create new objects 48 * @param exclude : the exclude stack contains objects beiing in the process of being built. 49 * @return boolean 50 * @throws KilimException : 51 */ 52 boolean checkValue(Stack exclude) throws KilimException; 53 54 /** 55 * returns the target element. This method has been introduced to deal with provider references. 56 * @return RuntimeElement 57 * @throws KilimException : generated when applied to an uninitialized provider reference. 58 */ 59 RuntimeElement getTarget() throws KilimException; 60 61 /** 62 * adds a new listener to the value source. 63 * @param aInterface : the collection port to be added to the list of listeners. 64 * @throws KilimException : the exception is generated when the method is invoked on unbound references 65 * or on illegal elements. 66 */ 67 void addInterfaceListener(RtCollectionPort aInterface) throws KilimException; 68 69 /** 70 * removes a listener from the value source. 71 * @param aInterface : the collection port to be removed from the list of listeners. 72 * @throws KilimException : the exception is generated when the method is invoked on unbound references 73 * or on illegal elements. 74 */ 75 void removeInterfaceListener(RtCollectionPort aInterface) throws KilimException; 76 77 /** 78 * returns whether the source is an event source.. 79 * @return boolean : is true when the source is the current event source. 80 */ 81 boolean isEventSource(); 82 83 /** 84 * sets the EventSourceValue. 85 * @param aValue : 86 * @throws KilimException : the exception is generated when the method is invoked on unbound references 87 * or on illegal elements. 88 */ 89 void setEventSourceValue(Object aValue) throws KilimException; 90 91 /** 92 * Method gets the EventSourceValue. 93 * @return Object 94 * @throws KilimException : the exception is generated when the method is invoked on unbound references 95 * or on illegal elements. 96 */ 97 Object getEventSourceValue() throws KilimException; 98 } 99