Hi all,
The reason for this is because of the following code in
HandlerLifecycleManager

requestContext.setProcessingComplete(false);
        String userDefinedValue = handlerManagers.get(
                USER_DEFINED_HANDLER_PHASE).put(requestContext);
        isProcessingComplete |= requestContext.isProcessingComplete();
        // The reporting handler phase needs to know about the state of
processing
        requestContext.setProcessingComplete(isProcessingComplete);

Here we can see we set the processing complete to false without considering
the previous state of processing complete and invoke the user defined
handler manager.

If we make it inside a if condition then this will work. The updated code
should be something like,

if (!isProcessingComplete) {
            String userDefinedValue = handlerManagers.get(
                USER_DEFINED_HANDLER_PHASE).put(requestContext);
            if (userDefinedValue != null) {
                defaultValue = systemSpecificValue;
            }
            isProcessingComplete = requestContext.isProcessingComplete();
        }
        requestContext.setProcessingComplete(isProcessingComplete);

@Senaka,
Do you have an idea why we did something like this?

thanks
Eranda



On Mon, Aug 4, 2014 at 1:33 PM, Danesh Kuruppu <[email protected]> wrote:

> Hi all,
>
> I created a custom handler and add resource inside mounted folder. When I
> update the property of that resource, custom handler invoke twice.
>
> Please clarify this,
>
> Thanks
> --
>
> Danesh Kuruppu
> Software Engineer
> WSO2 Inc,
> Mobile: +94 (77) 1690552
>



-- 

*Eranda Sooriyabandara*Senior Software Engineer;
Integration Technologies Team;
WSO2 Inc.; http://wso2.com
Lean . Enterprise . Middleware

E-mail: eranda AT wso2.com
Mobile: +94 716 472 816
Linked-In: http://www.linkedin.com/in/erandasooriyabandara
Blog: http://emsooriyabandara.blogspot.com/
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to