Hi Sameera,

On Thu, Nov 4, 2010 at 10:10 PM, Sameera Jayasoma
<[email protected]> 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: [email protected];  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to