Recent tomahawk ExtensionsFilter change breaks orchestra

View: New views
3 Messages — Rating Filter:   Alert me  

Recent tomahawk ExtensionsFilter change breaks orchestra

by simon.kitching@chello.at :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The following change has recently been made to TomahawkFacesContextWrapper:

Old code:
            if (addResource.requiresBuffer())
            {
                extensionsResponseWrapper = new
ExtensionsResponseWrapper(httpResponse);
                extendedResponse = extensionsResponseWrapper;
            }


New Code:
            if (addResource.requiresBuffer())
            {
                //If the request requires buffer, this was already
                //wrapped (on
TomahawkFacesContextFactory.getFacesContext(...) ),
                //but we need to save the wrapped response value
                //on a local variable to then reference it on release()
                //method and parse the old response.
                extensionsResponseWrapper = (ExtensionsResponseWrapper)
extendedResponse;
            }

Casting the "extendedResponse" object to a tomahawk-specific type
doesn't work if something else has wrapped the ResponseWrapper too. And
orchestra does exactly that.

So some other solution will be needed here.

PS: "extendedResponse" is no longer an appropriate name for this
variable. It was true in the filter approach, where the filter knows
exactly what the object is because it just created it. But in the
FacesContext approach, it can be any object that implements ServletResponse.

Regards,
Simon


Re: Recent tomahawk ExtensionsFilter change breaks orchestra

by Leonardo Uribe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Thu, Jul 10, 2008 at 8:26 AM, simon.kitching@... <simon.kitching@...> wrote:
The following change has recently been made to TomahawkFacesContextWrapper:

Old code:
          if (addResource.requiresBuffer())
          {
              extensionsResponseWrapper = new ExtensionsResponseWrapper(httpResponse);
              extendedResponse = extensionsResponseWrapper;
          }


New Code:
          if (addResource.requiresBuffer())
          {
              //If the request requires buffer, this was already
              //wrapped (on TomahawkFacesContextFactory.getFacesContext(...) ),
              //but we need to save the wrapped response value
              //on a local variable to then reference it on release()
              //method and parse the old response.
              extensionsResponseWrapper = (ExtensionsResponseWrapper) extendedResponse;
          }

Casting the "extendedResponse" object to a tomahawk-specific type doesn't work if something else has wrapped the ResponseWrapper too. And orchestra does exactly that.

So some other solution will be needed here.

Solved. Just pass the wrapped response on TomahawkFacesContextFactory as parameter. Fixed at revision 675608.
 

PS: "extendedResponse" is no longer an appropriate name for this variable. It was true in the filter approach, where the filter knows exactly what the object is because it just created it. But in the FacesContext approach, it can be any object that implements ServletResponse.

I removed this variable, since it is no longer used on this code.

Thanks for pointing this accurate observation.

regards

Leonardo Uribe
 

Regards,
Simon



Re: Recent tomahawk ExtensionsFilter change breaks orchestra

by simon.kitching@chello.at :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Leonardo Uribe schrieb:
> Solved. Just pass the wrapped response on TomahawkFacesContextFactory
> as parameter. Fixed at revision 675608.
Yep, that fixed it. Thanks.

LightInTheBox - Buy quality products at wholesale price