Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring batch 无法将Spring批处理配置为运行java类?_Spring Batch - Fatal编程技术网

Spring batch 无法将Spring批处理配置为运行java类?

Spring batch 无法将Spring批处理配置为运行java类?,spring-batch,Spring Batch,我使用下面的作业启动器来启动我的spring批处理作业,我想运行一个名为Notify的类,如何配置它 这是我的工作文件: <context:component-scan base-package="com.mkyong" /> <!-- stored job-meta in memory --> <bean id="jobRepository" class="org.springframework.batch.core.reposito

我使用下面的作业启动器来启动我的spring批处理作业,我想运行一个名为Notify的类,如何配置它

这是我的工作文件:

     <context:component-scan base-package="com.mkyong" />
     <!-- stored job-meta in memory -->
     <bean id="jobRepository"
class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean">
        <property name="transactionManager" ref="transactionManager" />
     </bean>
     <bean id="transactionManager"  class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
     <bean id="jobLauncher"
    class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
    <property name="jobRepository" ref="jobRepository" />
     </bean>
     <bean id="report" class="com.mkyong.model.Report" scope="prototype" />
     <bean id="customWriter" class="com.mkyong.writers.CustomWriter" />
     <bean id="notify" class="com.mkyong.model.Notify" />
      <constructor-arg>
      <bean class="org.springframework.batch.core.repository.dao.MapJobInstanceDao"/>
      </constructor-arg>
     </bean>
     <bean id="runScheduler" class="com.mkyong.RunScheduler" />

     <!-- Run every 5 seconds -->
     <task:scheduled-tasks>
    <!-- <task:scheduled ref="runScheduler" method="run" fixed-delay="5000" 
        /> -->
    <task:scheduled ref="runScheduler" method="run"
        cron="*/20 * * * * *" />
     </task:scheduled-tasks>
    </beans>

无论何时需要调用该类,都可以使用自动布线来实现此目的-

然后,您可以使用该类的实例来调用该类的相应方法

@autowire
@qualifier('notify') 
Notify nnotifyObject ;

你说跑步是什么意思?该xml中的notify类似乎是模型的一部分,只是一个javabean。代码已经从mkyong.com的网页上清晰地粘贴了出来。。。