1 ////////////////////////////////////////////////////////////////////////////
2 // ---------------------------------------------------------------------- //
3 // Copyright (C) 2006 - 2008 FRESCOR consortium partners: //
5 // Universidad de Cantabria, SPAIN //
6 // University of York, UK //
7 // Scuola Superiore Sant'Anna, ITALY //
8 // Kaiserslautern University, GERMANY //
9 // Univ. Politécnica Valencia, SPAIN //
10 // Czech Technical University in Prague, CZECH REPUBLIC //
12 // Thales Communication S.A. FRANCE //
13 // Visual Tools S.A. SPAIN //
14 // Rapita Systems Ltd UK //
17 // See http://www.frescor.org for a link to partners' websites //
19 // FRESCOR project (FP6/2005/IST/5-034026) is funded //
20 // in part by the European Union Sixth Framework Programme //
21 // The European Union is not liable of any use that may be //
22 // made of this code. //
25 // based on previous work (FSF) done in the FIRST project //
27 // Copyright (C) 2005 Mälardalen University, SWEDEN //
28 // Scuola Superiore S.Anna, ITALY //
29 // Universidad de Cantabria, SPAIN //
30 // University of York, UK //
32 // FSF API web pages: http:marte.unican.es/fsf/docs //
33 // http:shark.sssup.it/contrib/first/docs/ //
35 // This file is part of FORB (Frescor Object Request Broker) //
37 // FORB is free software; you can redistribute it and/or modify it //
38 // under terms of the GNU General Public License as published by the //
39 // Free Software Foundation; either version 2, or (at your option) any //
40 // later version. FORB is distributed in the hope that it will be //
41 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty //
42 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
43 // General Public License for more details. You should have received a //
44 // copy of the GNU General Public License along with FORB; see file //
45 // COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, //
46 // Cambridge, MA 02139, USA. //
48 // As a special exception, including FORB header files in a file, //
49 // instantiating FORB generics or templates, or linking other files //
50 // with FORB objects to produce an executable application, does not //
51 // by itself cause the resulting executable application to be covered //
52 // by the GNU General Public License. This exception does not //
53 // however invalidate any other reasons why the executable file might be //
54 // covered by the GNU Public License. //
55 ////////////////////////////////////////////////////////////////////////////
59 * @author Michal Sojka <sojkam1@fel.cvut.cz>
60 * @date Sat Oct 25 21:57:56 2008
62 * @brief FORB interface of resource manager
69 #include "../contract/fres_contract_idl.idl"
73 /** Resource manager */
74 interface resource_manager {
76 * Executes admission test and if the contracts are
77 * accepted, they are put to "reserved" state.
79 * @todo If a contract is in the "reserved" state, and
80 * reserve_contracts() is called again with the same
81 * contract, the previously reserved contract should
82 * be replaced with the new one.
84 * @param[in] contracts Contract(s) to negotiate,
85 * renegotiate or cancel. The operation on the
86 * contract is determined as follows:
87 * - cancel: contracts with an ID and without any block
89 * - neg: contracts with ID not present in current
90 * schedulability scenario.
92 * - reneg: contracts with ID present in current
93 * schedulability scenario.
96 * - Zero if reservation (admisson test) was successfull,
97 * - one if admission test was not successfull and
98 * - negative error code if an error occured.
100 long reserve_contracts(in contract::ptr_seq contracts);
103 * Puts contracts with given IDs to the "commited"
104 * state and sends back the changes to VRESes to reach
107 * @param[in] ids IDs of contracts to be commited.
109 * @param[out] schedulable_contracts Schedulable
110 * contracts, for new or changed VRESes. These
111 * contract may be extened by one or more data blocks
112 * for use by the allocator. The allocator receives
113 * the contracts in the same order as they are
116 void commit_contracts(in contract::id_seq ids,
117 out contract::ptr_seq schedulable_contracts);
120 * Cancels not-commited reservations.
122 * @param ids ID's of reserved contracts to be rolled-back
123 * to the state before reservation.
125 void cancel_reservations(in contract::id_seq ids);
127 * Returns the list of commited contracts
129 * @param contracts Commited contracts
131 * @param utilization Utilization in the range 0-100
132 * (for visualization) or -1 if utilization cannot be
135 void get_contracts(out contract::ptr_seq contracts, out long utilization);