source: xssim/src/test/rewolucja/scheduling/queue/GSSIMQueue.java @ 104

Revision 104, 1.4 KB checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package test.rewolucja.scheduling.queue;
2
3import java.util.ArrayList;
4
5import gridsim.Gridlet;
6import gridsim.gssim.SubmittedTask;
7
8import org.joda.time.DateTime;
9
10import schedframe.scheduling.Queue;
11import test.rewolucja.GSSIMJobInterface;
12
13public class GSSIMQueue extends ArrayList<GSSIMJobInterface> implements QueueInterface<GSSIMJobInterface>{
14
15
16        private static final long serialVersionUID = 6576299222910508209L;
17
18        protected String name;
19        protected int priority;
20        protected boolean supportReservation;
21       
22        public GSSIMQueue (boolean supportReservation){
23                name = "GSSIMQueue";
24                priority = 0;
25                this.supportReservation = supportReservation;
26        }
27       
28        public boolean add(GSSIMJobInterface<?> job){
29                try {
30                        job.setStatus(Gridlet.QUEUED);
31                } catch(Exception e){
32                        throw new RuntimeException(e);
33                }
34               
35                return super.add(job);
36        }
37       
38        public void add(int pos, GSSIMJobInterface<?> job){
39                try {
40                        job.setStatus(Gridlet.QUEUED);
41                } catch(Exception e){
42                        throw new RuntimeException(e);
43                }
44               
45                 super.add(pos, job);
46        }
47       
48        public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException {
49                //return get(pos).getSubmissionTimeToBroker();
50                return null;
51        }
52
53        public String getName() {
54                return name;
55        }
56
57        public int getPriority() {
58                return priority;
59        }
60
61        public void setName(String name) {
62                this.name = name;
63        }
64
65        public void setPriority(int priority) {
66                this.priority = priority;
67        }
68
69        public boolean supportReservations() {
70                return supportReservation;
71        }
72}
Note: See TracBrowser for help on using the repository browser.