You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Thomas Mäder (JIRA)" <ji...@apache.org> on 2007/09/24 12:06:51 UTC

[jira] Created: (WICKET-1002) Add lifecycle methods for Session

Add lifecycle methods for Session
---------------------------------

                 Key: WICKET-1002
                 URL: https://issues.apache.org/jira/browse/WICKET-1002
             Project: Wicket
          Issue Type: New Feature
          Components: wicket
    Affects Versions: 1.3.0-beta3
            Reporter: Thomas Mäder


Currently, there is no standard way to track the lifecycle of a org.apache.wicket.Session instance. This, however is useful when the Session object has to initialize/deinitialize, for example, to register listeners with a domain model, etc. 
I propose the introduction of an Session.onDestroy() method like on Application.

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


[jira] Updated: (WICKET-1002) Add lifecycle methods for Session

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

Thomas Mäder updated WICKET-1002:
---------------------------------


Yes, I could implement HttpSessionBindingListener  in the Session and have my own request cycle, but I see a couple of drawbacks to this:

1) it only works for non-temporary sessions. 
2) It depends on the exact implementation of the session store

I guess you can always work around the temporay-session problem, but I just think the init in the constructor/deinit in "onDestroy" would make client code so much easier to understand.

> Add lifecycle methods for Session
> ---------------------------------
>
>                 Key: WICKET-1002
>                 URL: https://issues.apache.org/jira/browse/WICKET-1002
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Thomas Mäder
>
> Currently, there is no standard way to track the lifecycle of a org.apache.wicket.Session instance. This, however is useful when the Session object has to initialize/deinitialize, for example, to register listeners with a domain model, etc. 
> I propose the introduction of an Session.onDestroy() method like on Application.

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


[jira] Commented: (WICKET-1002) Add lifecycle methods for Session

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538588 ] 

Johan Compagner commented on WICKET-1002:
-----------------------------------------

are you saying you also want this for temp sessions?
So we have to call onDestroy everytime a session is detached but is still a temp?

But you just have to implement HttpSessionBindingListener on your WebSession.
We already have a HttpSessionBindingListener but that calls Application.sessionDestroyed(sessionid)
Because you can't access the attrbute anymore. 
So that can only happen from the inside.

Should we have our own WebSession implement HttpSessionBindingListener?
and then call onDestroy() or something like that? That we also call for a temp session when it is detached?

You can easily do this yourself ofcourse.

> Add lifecycle methods for Session
> ---------------------------------
>
>                 Key: WICKET-1002
>                 URL: https://issues.apache.org/jira/browse/WICKET-1002
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Thomas Mäder
>             Fix For: 1.3.0-beta5
>
>
> Currently, there is no standard way to track the lifecycle of a org.apache.wicket.Session instance. This, however is useful when the Session object has to initialize/deinitialize, for example, to register listeners with a domain model, etc. 
> I propose the introduction of an Session.onDestroy() method like on Application.

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


[jira] Commented: (WICKET-1002) Add lifecycle methods for Session

Posted by "Eelco Hillenius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538597 ] 

Eelco Hillenius commented on WICKET-1002:
-----------------------------------------

We can't really guarantee this, since we don't guarantee that the session is bound to HttpSession, and the ISessionStore doesn't 's unbind method doesn't take the session object but rather the session id (and that is because of how the servlet API works).

Implementing this yourself should be trivial, and has the advantage that you don't have take the generic API into consideration.

> Add lifecycle methods for Session
> ---------------------------------
>
>                 Key: WICKET-1002
>                 URL: https://issues.apache.org/jira/browse/WICKET-1002
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Thomas Mäder
>             Fix For: 1.3.0-beta5
>
>
> Currently, there is no standard way to track the lifecycle of a org.apache.wicket.Session instance. This, however is useful when the Session object has to initialize/deinitialize, for example, to register listeners with a domain model, etc. 
> I propose the introduction of an Session.onDestroy() method like on Application.

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


[jira] Updated: (WICKET-1002) Add lifecycle methods for Session

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

Frank Bille Jensen updated WICKET-1002:
---------------------------------------

    Fix Version/s:     (was: 1.3.0-rc1)

> Add lifecycle methods for Session
> ---------------------------------
>
>                 Key: WICKET-1002
>                 URL: https://issues.apache.org/jira/browse/WICKET-1002
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Thomas Mäder
>
> Currently, there is no standard way to track the lifecycle of a org.apache.wicket.Session instance. This, however is useful when the Session object has to initialize/deinitialize, for example, to register listeners with a domain model, etc. 
> I propose the introduction of an Session.onDestroy() method like on Application.

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


[jira] Closed: (WICKET-1002) Add lifecycle methods for Session

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

Johan Compagner closed WICKET-1002.
-----------------------------------

    Resolution: Won't Fix

i am closing this as won't fix, you can do it yourself very easily by implementing the interface

> Add lifecycle methods for Session
> ---------------------------------
>
>                 Key: WICKET-1002
>                 URL: https://issues.apache.org/jira/browse/WICKET-1002
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Thomas Mäder
>             Fix For: 1.3.0-rc1
>
>
> Currently, there is no standard way to track the lifecycle of a org.apache.wicket.Session instance. This, however is useful when the Session object has to initialize/deinitialize, for example, to register listeners with a domain model, etc. 
> I propose the introduction of an Session.onDestroy() method like on Application.

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