Announcement Announcement Module
Collapse
No announcement yet.
trigger jobs with JMX and quartz Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • trigger jobs with JMX and quartz

    Hi all experts,
    I have JMX setup with help of 1.5 annotations and quartz running, at the moment a single job. How could I simply expose a Quartz schedule object so I can trigger jobs? See when they last run etc.. ?

    Thanks in advance..

    Code:
            <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter">
    		<property name="assembler" ref="assembler"/>
    		<property name="namingStrategy" ref="namingStrategy"/>
    		<property name="autodetect" value="true"/>
    	</bean>
    
    	<bean id="jmxAttributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>
    	
    	<!-- will create management interface using annotation metadata -->
    	<bean id="assembler" class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
    		<property name="attributeSource" ref="jmxAttributeSource"/>
    	</bean>
    
    	<!-- will pick up the ObjectName from the annotation -->
    	<bean id="namingStrategy" class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
    		<property name="attributeSource" ref="jmxAttributeSource"/>
    	</bean>
    
    	<bean
    		class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    		<property name="triggers">
    			<ref bean="cronTriggerClean" />
    		</property>
    	</bean>
    
    	<bean id="cronTriggerClean"
    		class="org.springframework.scheduling.quartz.CronTriggerBean">
    		<property name="jobDetail" ref="cleanJob" />
    	</bean>
    
    	<bean id="cleanJob"
    		class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    		<property name="targetObject" ref="cleanDirectory" />
    		<property name="targetMethod" value="doIt" />
    	</bean>

  • #2
    If I want to start up a job by Quartz, I write an MBean that receives a quarts scheduler and the name of the job to schedule. And this mbean schedules the job for immediate execution.

    Maybe the following blogpost is a nice read:
    http://pveentjer.wordpress.com/2006/...ency-problems/

    Comment

    Working...
    X