Skip to main content

[JIRA] Assigned: (SERVLET_SPEC-68) Change HttpSessionListener to extend new HttpSessionCreateListener, HttpSessionDestroyListener

  • From: "Shing Wai Chan (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [JIRA] Assigned: (SERVLET_SPEC-68) Change HttpSessionListener to extend new HttpSessionCreateListener, HttpSessionDestroyListener
  • Date: Wed, 24 Apr 2013 01:56:58 +0000 (UTC)
  • Auto-submitted: auto-generated


     [ 
https://java.net/jira/browse/SERVLET_SPEC-68?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shing Wai Chan reassigned SERVLET_SPEC-68:
------------------------------------------

    Assignee: Rajiv Mordani

> Change HttpSessionListener to extend new HttpSessionCreateListener, 
> HttpSessionDestroyListener
> ----------------------------------------------------------------------------------------------
>
>                 Key: SERVLET_SPEC-68
>                 URL: https://java.net/jira/browse/SERVLET_SPEC-68
>             Project: servlet-spec
>          Issue Type: Improvement
>            Reporter: beamerblvd
>            Assignee: Rajiv Mordani
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
>
> The HttpSessionListener interface contains two methods: sessionCreated() 
> and sessionDestroyed(). Sometimes listeners are only interested in creation 
> or destruction, but not both. Also, this prevents lambda expressions from 
> being passed to ServletContext#addListener(T) for creation and destruction 
> events. For example, I can add an HttpSessionIdListener listener to a 
> ServletContext with a lambda expression:
> {code}context.addListener((HttpSessionIdListener)(e, s) -> {
>     // do something
> });{code}
> I'd like to also be able to do:
> {code}context.addListener((HttpSessionCreateListener)(e) -> {
>     // do something
> });
> context.addListener((HttpSessionDestroyListener)(e) -> {
>     // do something
> });{code}
> Particularly, I might not care about creation events, so I might just do 
> the latter.
> I recommend:
> {code}interface HttpSessionCreateListener
>     - sessionCreated(HttpSessionEvent)
> interface HttpSessionDestroyListener
>     - sessionDestroyed(HttpSessionEvent)
> interface HttpSessionListener extends HttpSessionCreateListener, 
> HttpSessionDestroyListener{code}
> This would be a compile-safe change and would not break web applications 
> with existing HttpSessionListeners.
> There are a few other interfaces that could possibly use a similar 
> separation, though I am not suggesting that this be applied to ALL of them:
> {code}HttpSessionActivationListener:
>     HttpSessionActivateListener
>     HttpSessionPassivateListener
> HttpSessionAttributeListener:
>     HttpSessionAttributeAddListener
>     HttpSessionAttributeRemoveListener
>     HttpSessionAttributeReplaceListener
> HttpSessionBindingListener:
>     HttpSessionBindListener
>     HttpSessionUnbindListener
> ServletContextAttributeListener:
>     ServletContextAttributeAddListener
>     ServletContextAttributeRemoveListener
>     ServletContextAttributeReplaceListener
> ServletContextListener:
>     ServletContextDestroyListener
>     ServletContextInitializeListener
> ServletRequestAttributeListener:
>     ServletRequestAttributeAddListener
>     ServletRequestAttributeRemoveListener
>     ServletRequestAttributeReplaceListener
> ServletRequestListener:
>     ServletRequestDestroyListener
>     ServletRequestInitializeListener{code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[JIRA] Assigned: (SERVLET_SPEC-68) Change HttpSessionListener to extend new HttpSessionCreateListener, HttpSessionDestroyListener

Shing Wai Chan (JIRA) 04/24/2013
 
 
Close
loading
Please Confirm
Close