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.


Variable Index

 o fileName
The name of the trace file
 o traceFile
The trace file itself

Constructor Index

 o JobArrival(String)
Initialize the device by opening the trace file.

Method Index

 o start(Job, int)
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.

Variables

 o fileName
 private String fileName
The name of the trace file

 o traceFile
 private BufferedReader traceFile
The trace file itself

Constructors

 o JobArrival
 public JobArrival(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.

Methods

 o 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.

Parameters:
j - dummy argument to conform to the Device interface
dummy - dummy argument to conform to the Device interface
Overrides:
start in class Device
See Also:
Device