Revision 104,
876 bytes
checked in by wojtekp, 13 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Rev | Line | |
---|
[104] | 1 | package gridsim.gssim.policy.handlers; |
---|
| 2 | |
---|
| 3 | import schedframe.scheduling.Reservation; |
---|
| 4 | import gridsim.gssim.GssimTags; |
---|
| 5 | import gridsim.gssim.filter.ReservationFilter; |
---|
| 6 | import gridsim.gssim.resource.AbstractComputingResource; |
---|
| 7 | |
---|
| 8 | public class ReservationCompletedHandler extends PolicyEventHandler { |
---|
| 9 | |
---|
| 10 | private static final int tag = GssimTags.AR_STATUS_COMPLETED; |
---|
| 11 | |
---|
| 12 | public ReservationCompletedHandler(AbstractComputingResource resource) { |
---|
| 13 | super(resource); |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | public int getEventType() { |
---|
| 17 | return tag; |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | public void notify(double delay, Object data) { |
---|
| 21 | this.resource.send(this.resource.get_id(), delay, tag, data); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | public void cancel(Object data) { |
---|
| 25 | |
---|
| 26 | if (data instanceof Reservation) { |
---|
| 27 | Reservation reservation = (Reservation) data; |
---|
| 28 | ReservationFilter filter = new ReservationFilter(reservation |
---|
| 29 | .getId(), tag); |
---|
| 30 | this.resource.sim_cancel(filter, null); |
---|
| 31 | } |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.