Sure.
Due to the current design of the quartz component, the jobs have in their
information map
a reference to the component which is not serializable.
To work around this, I think the component should provide an implementation
of a JobFactory and
give to the scheduler. The JobFactory implementation will be given a
reference to the component,
and when creating the ServiceMixJob instance, will give this reference to
the job. This way, the
component do not have to be in the job map.
Something like:
class ServiceMixJobFactory implements JobFactory {
private QuartzComponent component;
public ServiceMixJobFactory(QuartzComponent component) {
this.component = component;
}
public Job <http://www.opensymphony.com/quartz/api/org/quartz/Job.html> *
newJob*(TriggerFiredBundle<http://www.opensymphony.com/quartz/api/org/quartz/spi/TriggerFiredBundle.html>
bundle)
{
return new ServiceMixJob(component);
}
}
Then, you need to create the appropriate constructor on ServiceMixJob and
make the component
configure the factory on the scheduler. And last, remove the component
reference from the job map.
Does this make sense ?
On 7/27/06, DivyaKumarVijay <[EMAIL PROTECTED]> wrote:
Hi Guillaume,
This is the quartzcomponent section of the xml file, which is used to pass
to servicemix as a parameter. Since I am a novice in all this, can you
please recommend, what is required as the quartzcomponent does not have a
property called JobFactory??
<sm:activationSpec componentName="timer" service="my:timer"
destinationService="my:receiver">
<sm:component><bean
class="org.apache.servicemix.components.quartz.QuartzComponent">
<property name="triggers">
<map>
<entry>
<key>
<bean class="org.quartz.SimpleTrigger">
<property name="repeatInterval" value="10000"/>
<property name="repeatCount" value="-1"/>
</bean>
</key>
<bean class="org.quartz.JobDetail">
<property name="name" value="Usage Replication Job"/>
<property name="group" value="ServiceMix"/>
</bean>
</entry>
</map>
</property>
</bean></sm:component>
</sm:activationSpec>
and the entries in the quartz.properties are:
#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName = OracleClusteredScheduler
org.quartz.scheduler.instanceId = AUTO
#============================================================================
# Configure ThreadPool
#============================================================================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 25
org.quartz.threadPool.threadPriority = 5
#============================================================================
# Configure JobStore
#============================================================================
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass =
org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = oracleDS
org.quartz.jobStore.tablePrefix = TQRTZ_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000
#============================================================================
# Configure Datasources
#============================================================================
org.quartz.dataSource.oracleDS.driver = oracle.jdbc.driver.OracleDriver
org.quartz.dataSource.oracleDS.URL =
jdbc:oracle:thin:@afleming.scotland.acec.com:1521:ppdev
org.quartz.dataSource.oracleDS.user = patrol
org.quartz.dataSource.oracleDS.password = patrol
org.quartz.dataSource.oracleDS.maxConnections = 5
org.quartz.dataSource.oracleDS.validationQuery=select 0 from dual
Cheers,
Divya
--
View this message in context:
http://www.nabble.com/Quartz-Cluster-Support-tf2008543.html#a5523196
Sent from the ServiceMix - User forum at Nabble.com.
--
Cheers,
Guillaume Nodet