svn-gvsig-desktop / tags / v2_0_0_Build_2020 / libraries / libRemoteServices / src / org / gvsig / remoteclient / taskplanning / FIFOTaskPlanner.java @ 33856
History | View | Annotate | Download (2.19 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program 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
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
|
42 |
/* CVS MESSAGES:
|
43 |
*
|
44 |
* $Id: FIFOTaskPlanner.java 29670 2009-06-29 17:17:55Z jpiera $
|
45 |
* $Log$
|
46 |
* Revision 1.1 2006-05-12 07:15:45 jaume
|
47 |
* *** empty log message ***
|
48 |
*
|
49 |
* Revision 1.1 2006/05/11 17:18:06 jaume
|
50 |
* Un planificador, monitorizador, de descargas que trabaja en segundo plano
|
51 |
*
|
52 |
*
|
53 |
*/
|
54 |
package org.gvsig.remoteclient.taskplanning; |
55 |
|
56 |
/**
|
57 |
* A simple FIFO task planner. The tasks returned by this planner are executed
|
58 |
* enterely. It does not issue another task until the current is finished.
|
59 |
* @author jaume
|
60 |
*
|
61 |
*/
|
62 |
public class FIFOTaskPlanner implements ITaskPlanner { |
63 |
IQueue queue; |
64 |
|
65 |
/**
|
66 |
* Creates a new instance of FIFOTaskPlanner that will work against the
|
67 |
* queue passed as paramenter
|
68 |
* @param queue, the IQueue to be planned
|
69 |
*/
|
70 |
public FIFOTaskPlanner(IQueue queue) {
|
71 |
this.queue = queue;
|
72 |
} |
73 |
|
74 |
|
75 |
public IRunnableTask nextTask() {
|
76 |
synchronized (this) { |
77 |
return (IRunnableTask) queue.getTasks().remove(0); |
78 |
} |
79 |
} |
80 |
/**
|
81 |
* FIFO plans have no previous tasks so, null is always returned.
|
82 |
*/
|
83 |
public IRunnableTask previousTask() {
|
84 |
return null; |
85 |
} |
86 |
|
87 |
} |