ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Kulichenko <valentin.kuliche...@gmail.com>
Subject Re: It seems WebSession's removeAttribute does not support HttpSessionBindingListener
Date Wed, 28 Jun 2017 19:05:34 GMT
Hi,

Good catch! I created a ticket for this:
https://issues.apache.org/jira/browse/IGNITE-5607

Are you willing to pick it up and contribute the fix?

-Val

On Wed, Jun 28, 2017 at 3:25 AM, yucigou <yuci.gou@gmail.com> wrote:

> When a session expires or is invalidated, or a session attribute gets
> removed, etc., HttpSessionBindingListener's valueUnbound callback function
> should be fired.
>
> However, it seems that WebSession's removeAttribute does not support
> HttpSessionBindingListener. (I'm referring to the Ignite Web module.)
>
> class WebSession implements HttpSession, Externalizable {
>
>     /** {@inheritDoc} */
>     @Override public void removeAttribute(String name) {
>         if (!isValid)
>             throw new IllegalStateException("Call on invalidated
> session!");
>
>         attrs.remove(name);
>
>         if (updates != null)
>             updates.add(new T2<>(name, null));
>     }
>
> ...
>
> Somehow, our application relies on the HttpSessionBindingListener's
> valueUnbound callback function getting called to clean up resources.
>
> Any advice please?
>
> PS.:
> Tomcat's implementation of HttpSession looks like:
>
> StandardSession.java
>
>     protected void removeAttributeInternal(String name, boolean notify) {
>         // Avoid NPE
>         if (name == null) return;
>         // Remove this attribute from our collection
>         Object value = attributes.remove(name);
>         // Do we need to do valueUnbound() and attributeRemoved()
> notification?
>         if (!notify || (value == null)) {
>             return;
>         }
>         // Call the valueUnbound() method if necessary
>         HttpSessionBindingEvent event = null;
>         if (value instanceof HttpSessionBindingListener) {
>             event = new HttpSessionBindingEvent(getSession(), name,
> value);
>             ((HttpSessionBindingListener) value).valueUnbound(event);
>         }
> ...
>
>
>
> --
> View this message in context: http://apache-ignite-
> developers.2346864.n4.nabble.com/It-seems-WebSession-s-
> removeAttribute-does-not-support-HttpSessionBindingListener-tp19184.html
> Sent from the Apache Ignite Developers mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message