//doing something
//... bla boo bla
//here comes the beginning of our complex process
try{
CallExecution execution = producer.getStats("phase1").createCallExecution();
execution.startExecution();
//now we are doing something extremely important...
execution.finishExecution();
//now we are doing phase 2. For whatever reasons we have to do it in a loop or something.
for (int i=0; i<3; i++){
execution = producer.getStats("phase2").createCallExecution();
execution.startExecution();
//now we are doing something extremely important...
execution.finishExecution();
}
//no we do something else, until we finally have to do the last phase twice...
execution = producer.getStats("phase3").createCallExecution();
execution.startExecution();
//now we are doing something extremely important...
execution.finishExecution();
execution = producer.getStats("phase3").createCallExecution();
execution.startExecution();
//now we are doing something extremely important...
execution.finishExecution();
//now we are all set
}catch(OnDemandStatsProducerException e){