You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Emond Papegaaij (JIRA)" <ji...@apache.org> on 2009/01/14 14:21:02 UTC

[jira] Created: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Callback after detaching the page but before the PageMap lock is released
-------------------------------------------------------------------------

                 Key: WICKET-2020
                 URL: https://issues.apache.org/jira/browse/WICKET-2020
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 1.3.5
            Reporter: Emond Papegaaij


Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664033#action_12664033 ] 

Emond Papegaaij commented on WICKET-2020:
-----------------------------------------

But that would put the callback before the request targets are detached. We need a callback after the targets are detached, probably just before '// let the session cleanup after a request, flushing changes etc.'. Overriding the method and detaching the request targets by hand is not possible, because 'requestTargets' is private.

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Martijn Dashorst (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martijn Dashorst updated WICKET-2020:
-------------------------------------

    Fix Version/s: 1.4.1
                   1.3.8

Was further implemented in 1.4.1 and 1.3.8

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.8, 1.4-RC2, 1.4.1
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664029#action_12664029 ] 

Martin Grigorov commented on WICKET-2020:
-----------------------------------------

Looking at the code of o.a.w.RequestCycle I think you could do this yourself by extending WebRequestCycle, configure the new one by MyApp#newRequestCycle(), and the code should looks like:

@Override
public void detach() {
  onAfterTargetDetach();
  super.detach();
}

private void onAfterTargetDetach() {
  if (Application.DEVELOPMENT.equals(Application.get().getConfigurationType()) {
     // your logic here
  }
}

detach() is not part of the public API but since you use it only in development mode I think it is safe

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-2020.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4-RC2
         Assignee: Juergen Donnerstag

I changed to the javadoc to explain that detach() should not be called by any user, but that subclassing is allowed.

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Juergen Donnerstag
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2020.
-----------------------------------

    Resolution: Fixed

see IDetachListener and IFrameworkSettings#setDetachListener

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666997#action_12666997 ] 

Igor Vaynberg commented on WICKET-2020:
---------------------------------------

why not just subclass detach() in your base page?

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Juergen Donnerstag
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667206#action_12667206 ] 

Emond Papegaaij commented on WICKET-2020:
-----------------------------------------

Overriding detach() in our base page is not reliable, because it requires all subclasses that currently override detach() to first detach their own models and then call super.detach() (otherwise the check will be executed before all models are detached). The problem lies in the fact that detach() IS the detach phase, which makes it difficult to check if the detach HAS BEEN performed correctly.

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Juergen Donnerstag
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-2020:
-------------------------------------

    Assignee: Igor Vaynberg  (was: Juergen Donnerstag)

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667609#action_12667609 ] 

Emond Papegaaij commented on WICKET-2020:
-----------------------------------------

Well, we are still on 1.3.5, and we won't switch to an RC, so it will have to wait until 1.4 is final.

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667605#action_12667605 ] 

Emond Papegaaij commented on WICKET-2020:
-----------------------------------------

Thanks, that seems like a nice solution. Will this be in 1.4?

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667607#action_12667607 ] 

Igor Vaynberg commented on WICKET-2020:
---------------------------------------

yes, you can build wicket yourself from trunk if you want to have it now, or wait for 1.4-rc2

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Igor Vaynberg
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (WICKET-2020) Callback after detaching the page but before the PageMap lock is released

Posted by "Emond Papegaaij (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emond Papegaaij reopened WICKET-2020:
-------------------------------------


By overriding detach, it is only possible to insert code at the beginning or end of the original method. That is not good enough for us. We want to check the entire component hierarchy for database objects, to verify that all models were detached correctly. For this, the component hierarchy must be detached (1st block in detach), but the page map must not yet be released (4th block in detach). Inserting code before super.detach() would execute our code too soon; the models are not yet detached. Inserting code after super.detach() (or, as we do it now, in onEndRequest()) is too late, because the page map is no longer locked.

> Callback after detaching the page but before the PageMap lock is released
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2020
>                 URL: https://issues.apache.org/jira/browse/WICKET-2020
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Emond Papegaaij
>            Assignee: Juergen Donnerstag
>             Fix For: 1.4-RC2
>
>
> Currently, it is not possible to perform any checks on a page after the request has been detached. In onEndRequest, the PageMap lock has already been cleared, making it unsafe to access the pages involved in the request. Would it be possible to add an extra callback method (ie. onAfterTargetDetach()) to RequestCycle directly after detaching the request targets? We need such a callback to check (in development mode) if all models are detached correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.