hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colin Taylor <colin.tay...@gmail.com>
Subject Using an existing factory - quartz integration
Date Thu, 17 Nov 2005 04:04:03 GMT
Hi there,

can anyone share the best way of invoking an existing factory to use with
the set-object directive?
I'm trying to integrate quartz, whose scheduler is commonly constructed :

StdSchedulerFactory schedFactory = new StdSchedulerFactory();
try {
quartz = (org.quartz.Scheduler) schedFactory.getScheduler();
quartz.start();
}


I would like to use the existing StdSchedulerFactory with set-object rather
than create a new factory or create a service to invoke the existing factory
which would be complete overkill considering I'm only going to make one
quartz object. Is this possible?

I've got as far as:

<service-point id="Scheduler" interface="com. ...MyScheduler">
<invoke-factory model="pooled">
<construct class="com....impl.MySchedulerImpl">
<set-object property="quartzScheduler" value="???"/>
</construct>
</invoke-factory>
</service-point>


One nice way I thought of was having groovy configuration scraps in the xml.

so :
<service-point id="Scheduler" interface="com. ...MyScheduler">
<invoke-factory model="pooled">
<construct class="com....impl.MySchedulerImpl">
<set-object property="quartzScheduler"
<groovy>
schedFactory = new org.quartz.StdSchedulerFactory();
quartz =schedFactory.getScheduler();
quartz.start();
return quartz; /// put as value attribute on set-object
</groovy>
</set-object>
</construct>
</invoke-factory>
</service-point>






As an aside having a dtd or xsd would be a big addition to Hiveminds rather
opaque documentation.

Cheers
Colin.

Mime
View raw message