1 | package de.uka.ipd.sdq.scheduler.events; |
2 | |
3 | import org.apache.log4j.Logger; |
4 | |
5 | import de.uka.ipd.sdq.scheduler.LoggingWrapper; |
6 | import de.uka.ipd.sdq.scheduler.SchedulerModel; |
7 | import de.uka.ipd.sdq.scheduler.resources.IResourceInstance; |
8 | import de.uka.ipd.sdq.scheduler.resources.active.SimActiveResource; |
9 | import de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEventDelegator; |
10 | |
11 | /** |
12 | * Event causing a call to the schedule method of the specified scheduling |
13 | * strategy. Used to trigger a scheduling at a specific time. |
14 | * |
15 | * This Event will never be canceled and can exist an arbitrary number of times in the event queue. |
16 | * |
17 | * @author jens |
18 | * |
19 | */ |
20 | public class SchedulingInterruptEvent extends AbstractSimEventDelegator<IResourceInstance> { |
21 | |
22 | SimActiveResource containingResource; |
23 | static Logger logger = Logger.getLogger(SchedulingInterruptEvent.class); |
24 | |
25 | public SchedulingInterruptEvent(SchedulerModel model, SimActiveResource containingResource) { |
26 | super(model, SchedulingEvent.class.getName()); |
27 | this.containingResource = containingResource; |
28 | } |
29 | |
30 | @Override |
31 | public void eventRoutine(IResourceInstance instance) { |
32 | LoggingWrapper.log("Scheduling Interrupt Event handler triggered"); |
33 | containingResource.getScheduler().schedule(instance/*,quantum_finished*/); |
34 | } |
35 | |
36 | } |