synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiranya Jayathilaka <hiranya...@gmail.com>
Subject Re: Behaviour of a Synapse Task which implements the ManagedLifeCycle interface
Date Thu, 04 Nov 2010 17:10:01 GMT
Hi Sameera,

On Thu, Nov 4, 2010 at 10:10 PM, Sameera Jayasoma
<sameera.madushan@gmail.com> wrote:
> Hi devs,
>
> Say I have a Synapse task which implements the ManagedLifeCycle interface.
>
> Public class TestTask implements Task, ManagedLifeCyle {
>   public void init(SynapseEnvironment se){
>   }
>   public void execute() {
>   }
> }
>
> Synapse triggers the task as specified in the synapse.xml.  This init()
> method is always invoked when the task is triggered. Is this the expected
> behaviour?

Yes, this is the expected behavior of the SimpleQuartzJob impl. This
enables user to have a little bit of extra pre-execution and
post-execution logic in the task implementation. In fact the Task
object is created new for each execution. The only thing that lives
through is the corresponding Startup object which holds the
description of the task.

According to the current impl, tasks are essentially stateless.
Meaning one execution does not depend on other executions.

Thanks,
Hiranya

>
> Thanks
> Sameera
> --
> Sameera Jayasoma
> Technical Lead
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://tech.jayasoma.org
>



-- 
Hiranya Jayathilaka
Senior Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

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


Mime
View raw message