====== JobExplorer ====== ===== 개요 ===== JobExplorer는 실행 중인 Job 및 Step의 execution을 검색하기 위한 시작지점으로, Repository에 접근하여 배치작업에 대한 정보를 얻는다. ===== 설명 ===== JobExplorer에서는 Repository에 있는 Execution의 데이터를 사용하기 위해서 Repository에 접근한다.JobExplorer은 repository의 데이터를 오직 읽을 수만 있다. public interface JobExplorer { List getJobInstances(String jobName, int start, int count); JobExecution getJobExecution(Long executionId); StepExecution getStepExecution(Long jobExecutionId, Long stepExecutionId); JobInstance getJobInstance(Long instanceId); List getJobExecutions(JobInstance jobInstance); Set findRunningJobExecutions(String jobName); } JobExplorer인터페이스의 기본 구현 클래스로는 SimpleJobExplorer을 제공한다. SimpleJobExplorer는 멤버변수로 JobInstanceDao,JobExecutionDao, StepExecutionDao, ExecutionContextDao 구성되어 DB에 접근하여 아래의 기능들을 제공한다. ^ 메소드명 ^ 설 명 ^ 파라미터 ^ |getJobExecutions|jobInstance를 이용하여 JobExecutions을 얻는다.|jobInstance| |findRunningJobExecutions|jobName을 이용하여 실행중인 Job의 JobExecutions을 얻는다.|jobName| |getJobExecution|Job의 execution Id를 이용하여 JobExecutions을 얻는다. |executionId| |getParameters|Job의 Execution id를 이용하여 Parameters를 얻는다. |executionId| |getStepExecution|Job의 execution Id와 Step의 execution Id를 이용하여 StepExecution을 얻는다.|jobExecutionId,stepExecutionId| |getJobInstance|Jobinstance Id를 이용하여 JobInstance를 얻는다.|instanceId| |getJobInstances|start 인덱스부터 count만큼의 JobInstances을 얻는다.|jobName, int start, int count| |getJobInstance|jobExecution를 이용하여 JobInstance를 얻는다.|jobExecution| JobExplorer의 생성을 도와주는 FactoryBean클래스가 제공되어서 이를 사용하면 더욱 손쉽게 설정할 수 있다.JobExplorerFactoryBean을 이용하여 JobExplorer 설정시에는 dataSource의 설정이 필수이다. ✔[[egovframework:rte2:brte:batch_core:job_repository#Changing the Table Prefix|JobRepository]]의 설정에서 테이블 접두사를 변경했다면, JobExplorer의 설정 시에도 동일한 테이블 접두사로 변경해야 한다. ===== 참고자료 ===== * http://static.springsource.org/spring-batch/reference/html/configureJob.html#queryingRepository