KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > control > activity > ActiveComponentAttributeController


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 INRIA Rhone-Alpes
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: dream@objectweb.org
20  *
21  * Initial developer(s): Vivien Quema
22  * Contributor(s):
23  */

24
25 package org.objectweb.dream.control.activity;
26
27 import org.objectweb.fractal.api.control.AttributeController;
28
29 /**
30  * This attribute controller can be used by active components that need
31  * registering one or more tasks. It must be used by components using the
32  * {@link org.objectweb.dream.control.activity.task.ThreadPerTaskTaskManagerControllerMixin}
33  * activity manager. It allows defining whether tasks have to be executed by a
34  * thread pool or only by a thread. Moreover, in cases the thread pool has been
35  * chosen, it allows setting the initial number of threads, as well as the max
36  * capacity of the pool.
37  *
38  * @see org.objectweb.dream.control.activity.task.thread.ThreadPoolController
39  */

40 public interface ActiveComponentAttributeController extends AttributeController
41 {
42   /**
43    * Determines whether a pool of threads should be used for each task of the
44    * component.
45    *
46    * @param usePool the value to set.
47    */

48   void setUsePool(boolean usePool);
49
50   /**
51    * Indicates whether a pool of threads is used for each task of the component.
52    *
53    * @return <code>true</code> if task is executed by a pool of thread.
54    */

55   boolean getUsePool();
56
57   /**
58    * Sets the initial capacity of the pool.
59    *
60    * @param i the initial capacity of the pool.
61    */

62   void setInitialCapacity(int i);
63
64   /**
65    * Returns the maximum capacity of the pool.
66    *
67    * @return the maximum capacity of the pool.
68    */

69   int getInitialCapacity();
70
71   /**
72    * Sets the initial number of threads in the pool.
73    *
74    * @param i the initial number of threads in the pool.
75    */

76   void setInitialNumberOfThreads(int i);
77
78   /**
79    * Returns the initial number of threads in the pool.
80    *
81    * @return the initial number of threads in the pool.
82    */

83   int getInitialNumberOfThreads();
84
85 }
Popular Tags