hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Achim Hügen <achim.hue...@gmx.de>
Subject Re: Using an existing factory - quartz integration
Date Thu, 17 Nov 2005 20:31:07 GMT
Define StdSchedulerFactory as service and then
use the service-property ObjectProvider to call the getService-Method:

     <service-point id="SchedulerFactory"  
interface="org.quartz.StdSchedulerFactory">
         <invoke-factory>
             <construct class="org.quartz.StdSchedulerFactory" />
         </invoke-factory>
     </service-point>

     <service-point id="Scheduler" interface="com. ...MyScheduler">
         <invoke-factory model="pooled">
             <construct class="com....impl.MySchedulerImpl"  
initialize-method="mystart">
                 <set-object property="quartzScheduler"
                    value="service-property:SchedulerFactory:scheduler"/>
             </construct>
         </invoke-factory>
     </service-point>

The MyScheduler class will have to call the start method of the
quartz scheduler in its mystart method.

Bye
Achim Huegen

Am Thu, 17 Nov 2005 05:04:03 +0100 schrieb Colin Taylor  
<colin.taylor@gmail.com>:

> 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.



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message