Class JobArrival
java.lang.Object
|
+--Device
|
+--JobArrival
- class JobArrival
- extends Device
JobArrival is a phony kind of device that "interrupts" when a new
job arrives in the system.
It works by reading a trace file that indicates the starting times
and resource requirements of jobs that were actually run on a real
system.
|
Field Summary |
private java.lang.String |
fileName
The name of the trace file |
private java.io.BufferedReader |
traceFile
The trace file itself |
|
Constructor Summary |
JobArrival(java.lang.String fname)
Initialize the device by opening the trace file. |
|
Method Summary |
void |
start(Job j,
int dummy)
Read the next (or first) job description from the input file,
skipping molformed lines, and make it the current job, with
a simulated interrupt occurring at the arrival time of the job. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
fileName
private java.lang.String fileName
- The name of the trace file
traceFile
private java.io.BufferedReader traceFile
- The trace file itself
JobArrival
public JobArrival(java.lang.String fname)
- Initialize the device by opening the trace file.
The first line is read whenever the device is started.
- Parameters:
fname - the name of the trace file.
start
public void start(Job j,
int dummy)
- Read the next (or first) job description from the input file,
skipping molformed lines, and make it the current job, with
a simulated interrupt occurring at the arrival time of the job.
If no more valid lines appear in the file, schedule an interrupt
at time inifinity.
- Overrides:
- start in class Device
- Parameters:
j - dummy argument to conform to the Device interfacedummy - dummy argument to conform to the Device interface- See Also:
Device