1 /* 2 * ################################################################ 3 * 4 * ProActive: The Java(TM) library for Parallel, Distributed, 5 * Concurrent computing with Security and Mobility 6 * 7 * Copyright (C) 1997-2002 INRIA/University of Nice-Sophia Antipolis 8 * Contact: proactive-support@inria.fr 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License as published by the Free Software Foundation; either 13 * version 2.1 of the License, or any later version. 14 * 15 * This library is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 * Lesser General Public License for more details. 19 * 20 * You should have received a copy of the GNU Lesser General Public 21 * License along with this library; if not, write to the Free Software 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 * USA 24 * 25 * Initial developer(s): The ProActive Team 26 * http://www.inria.fr/oasis/ProActive/contacts.html 27 * Contributor(s): 28 * 29 * ################################################################ 30 */ 31 package org.objectweb.proactive; 32 33 /** 34 * <P> 35 * RunActive is related to the activity of an active object. 36 * When an active object is started, which means that its 37 * active thread starts and serves the requests being sent 38 * to its request queue, it is possible to define exactly how 39 * the activity (the serving of requests amongst others) will 40 * be done. 41 * </P><P> 42 * An object implementing this interface is invoked to run the 43 * activity until an event trigger its end. The object being 44 * reified as an active object can directly implement this interface 45 * or an external class can also be used. 46 * </P> 47 * <P> 48 * It is the role of the body of the active object to perform the 49 * call on the object implementing this interface. For an active object 50 * to run an activity, the method <code>runActivity</code> must not end 51 * before the end of the activity. When the method <code>runActivity</code> 52 * ends, the activity ends too and the <code>endActivity</code> can be invoked. 53 * </P> 54 * <P> 55 * Here is an example of a simple implementation of <code>runActivity</code> method 56 * doing a FIFO service of the request queue : 57 * </P> 58 * <pre> 59 * public void runActivity(Body body) { 60 * Service service = new Service(body); 61 * while (body.isActive()) { 62 * service.blockingServeOldest(); 63 * } 64 * } 65 * </pre> 66 * 67 * @author ProActive Team 68 * @version 1.0, 2002/06 69 * @since ProActive 0.9.3 70 */ 71 public interface RunActive extends Active { 72 73 /** 74 * Runs the activity of the active object. 75 * @param <code>body</code> the body of the active object being started 76 */ 77 public void runActivity(Body body); 78 79 } 80 81 82