Class QuartzEventSchedulerFactoryBean
java.lang.Object
org.axonframework.spring.eventhandling.scheduling.quartz.QuartzEventSchedulerFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.FactoryBean<org.axonframework.eventhandling.scheduling.quartz.QuartzEventScheduler>,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class QuartzEventSchedulerFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<org.axonframework.eventhandling.scheduling.quartz.QuartzEventScheduler>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
Spring FactoryBean that creates a QuartzEventScheduler instance using resources found in the Spring Application
Context. The QuartzEventScheduler delegates the actual scheduling and triggering to a Quartz Scheduler, making it
more suitable for long-term triggers and triggers that must survive a system restart.
- Since:
- 1.1
- Author:
- Allard Buijze
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.axonframework.eventhandling.scheduling.quartz.QuartzEventSchedulerClass<?>booleanvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetEventBus(org.axonframework.eventhandling.EventBus eventBus) Sets the event bus to which scheduled events need to be published.voidsetEventJobDataBinder(org.axonframework.eventhandling.scheduling.quartz.EventJobDataBinder eventJobDataBinder) Sets theEventJobDataBinderinstance which reads / writes the event message to publish to theJobDataMap.voidsetGroupIdentifier(String groupIdentifier) Sets the group identifier to use when scheduling jobs with Quartz.voidsetScheduler(org.quartz.Scheduler scheduler) Sets the backing Quartz Scheduler for this timer.voidsetSerializer(org.axonframework.serialization.Serializer serializer) Sets theSerializerused by theEventJobDataBinder.voidsetTransactionDefinition(org.springframework.transaction.TransactionDefinition transactionDefinition) The TransactionDefinition to use by the transaction manager.voidsetTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Sets the transaction manager that manages the transaction around the publication of an event.
-
Constructor Details
-
QuartzEventSchedulerFactoryBean
public QuartzEventSchedulerFactoryBean()
-
-
Method Details
-
getObject
public org.axonframework.eventhandling.scheduling.quartz.QuartzEventScheduler getObject()- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<org.axonframework.eventhandling.scheduling.quartz.QuartzEventScheduler>
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<org.axonframework.eventhandling.scheduling.quartz.QuartzEventScheduler>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<org.axonframework.eventhandling.scheduling.quartz.QuartzEventScheduler>
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
setApplicationContext
public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setScheduler
public void setScheduler(org.quartz.Scheduler scheduler) Sets the backing Quartz Scheduler for this timer.- Parameters:
scheduler- the backing Quartz Scheduler for this timer
-
setEventBus
public void setEventBus(org.axonframework.eventhandling.EventBus eventBus) Sets the event bus to which scheduled events need to be published.- Parameters:
eventBus- the event bus to which scheduled events need to be published.
-
setGroupIdentifier
Sets the group identifier to use when scheduling jobs with Quartz. Defaults to "AxonFramework-Events".- Parameters:
groupIdentifier- the group identifier to use when scheduling jobs with Quartz
-
setEventJobDataBinder
public void setEventJobDataBinder(org.axonframework.eventhandling.scheduling.quartz.EventJobDataBinder eventJobDataBinder) Sets theEventJobDataBinderinstance which reads / writes the event message to publish to theJobDataMap. Defaults toQuartzEventScheduler.DirectEventJobDataBinder.- Parameters:
eventJobDataBinder- to use
-
setTransactionManager
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) Sets the transaction manager that manages the transaction around the publication of an event. If a transaction manager is not specified, no transactions are managed around the event publication.- Parameters:
transactionManager- the transaction manager that takes care of transactions around event publication
-
setTransactionDefinition
public void setTransactionDefinition(org.springframework.transaction.TransactionDefinition transactionDefinition) The TransactionDefinition to use by the transaction manager. Defaults to aDefaultTransactionDefinition. Is ignored if no transaction manager is configured.- Parameters:
transactionDefinition- the TransactionDefinition to use by the transaction manager
-
setSerializer
public void setSerializer(org.axonframework.serialization.Serializer serializer) Sets theSerializerused by theEventJobDataBinder. TheEventJobDataBinderuses theSerializerto de-/serialize the scheduled event.- Parameters:
serializer- aSerializerused by theEventJobDataBinderwhen serializing events
-