synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankha C. Perera" <asan...@wso2.com>
Subject Re: Simplifying the use of Quartz
Date Thu, 02 Aug 2007 05:32:06 GMT
+1

asankha

Paul Fremantle wrote:
> I've written a Quartz plugin for Synapse, which allows Quartz Jobs to
> be run by Quartz in the context of Synapse. In particular, they have
> access to the SynapseEnvironment, so that they can inject messages
> into Synapse.
>
> However, the Quartz model isn't quite as simple as the Synapse model
> (in my opinion).
> Basically Quartz Jobs implement a method
> public void execute(JobExecutionContext arg0) throws JobExecutionException
>
> And from the JobExecutionContext they get any properties they need.
>
> The jobs can be specified either programmatically or using Quartz XML
> syntax, but the Quartz syntax is a bit "heavy". For example in synapse
> we set a property this way:
>
> <property name="address" value="urn:gmond"/>
>
> In Quartz its like this:
> <quartz:entry>
>      <quartz:key>port</quartz:key>
>      <quartz:value>8649</quartz:value>
> </quartz:entry>
>
> Since I've already coded support for the Quartz model, I suggest we
> keep that as one approach, but I think we could make life much simpler
> for users:
>
> Here is a proposed XML:
>
> <job class="org.my.synapse.job">
>    <property name="stringProp" value="String"/>
>    <property name="xmlProp">
>       <somexml>config</somexml>
>    </property>
>    <simpletrigger count="-1" interval="1000"/>
>    <crontrigger expression="0 * 1 * * ?"/>
> </job>
>
> We will use Quartz under the covers to call our own job handling code,
> which can use injection to inject the properties into the Job instance
> and then call execute(); on the Job.
>
> This basically makes it simpler to write AND configure a job.
>
> Paul
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message