1 | package de.uka.ipd.sdq.scheduler.events; |
2 | |
3 | import org.apache.log4j.Level; |
4 | import org.apache.log4j.Logger; |
5 | |
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 | * @author jens |
16 | * |
17 | */ |
18 | public class SchedulingEvent extends AbstractSimEventDelegator<IResourceInstance> { |
19 | |
20 | SimActiveResource containingResource; |
21 | |
22 | static Logger logger = Logger.getLogger(SchedulingEvent.class); |
23 | |
24 | static{ |
25 | logger.setLevel(Level.INFO); |
26 | } |
27 | |
28 | public SchedulingEvent(SchedulerModel model, SimActiveResource containingResource) { |
29 | super(model, SchedulingEvent.class.getName()); |
30 | this.containingResource = containingResource; |
31 | } |
32 | |
33 | @Override |
34 | public void eventRoutine(IResourceInstance instance) { |
35 | logger.debug(getModel().getSimulationControl().getCurrentSimulationTime() + " Scheduling Event handler triggered"); |
36 | containingResource.getScheduler().schedule(instance); |
37 | } |
38 | |
39 | } |