In this post under java, I will show how to browse a jar file programmatically. For the example I will browse the mockito jar file. So I will add the “mockito-core-2.11.0.jar” in the classpath of the java file. Below is the complete code for browsing the jar file programmatically Main Code 1 package jar; 2…… Continue reading Exploring jar files programmatically
Month: November 2018
Validating JobParameters using JobParametersValidator interface
In this post under Spring Batch, I will explain how to validate the parameters passed to the job instance. The interface we will be using for validating the Job parameters is org.springframework.batch.core.JobParametersValidator which has only one method as shown below public interface JobParametersValidator { void validate(JobParameters parameters) throws JobParametersInvalidException; } Based on the signature of…… Continue reading Validating JobParameters using JobParametersValidator interface
Passing Job Parameters using JobParametersBuilder
In this post under Spring Batch I will explain how to pass parameters to a job. We will take the help of org.springframework.batch.core.JobParametersBuilder class which follows Builder design pattern. We will use JobParametersBuilder class to build the job parameters. Then we pass the job parameters along with the job (to be executed) as parameters to…… Continue reading Passing Job Parameters using JobParametersBuilder
Adding Job Listener using JobListener Interface
In this post of Quartz, I will explain how to add listeners to listen for job events. We can use the listeners to listen for job events and add custom logic at these points. We need to create a class that implements org.quartz.JobListener interface or extends org.quartz.listeners.JobListenerSupport class and override interested events. For our example…… Continue reading Adding Job Listener using JobListener Interface