From the course: Learning Java Enterprise Edition

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Batch in practice, part 2

Batch in practice, part 2 - Java EE Tutorial

From the course: Learning Java Enterprise Edition

Start my 1-month free trial

Batch in practice, part 2

- [Instructor] Okay, so let's do the code that runs this process. This all happens in the UploadDirectoryScanner class, so let's open that and see what's going on. Here you can see that it's a stateless EJB and that we have a scheduled annotation that executes the processFiles method every two minutes. These go to a list specified by a cron job syntax. In the real world applications, it would be executed with less frequency, perhaps, let's say, every 15 minutes. What happens when this method is called is that the batch process is started by loading the EventFilesProcessorJob XML file. This file contains the configuration necessary to batch process cargo events defined in the Job Specification Language we saw earlier on in the slides. So let's have a look at this file then. Notice that this is a more complex version of the JSL that you saw in the previous video. We have a job defined as EventFilesProcessorJob, and here, I have chosen to define a few directories. The upload_directory…

Contents