Package javax.servlet.http

Examples of javax.servlet.http.HttpSessionBindingListener


  {
    if (oldValue == null)
      return;

    if (oldValue instanceof HttpSessionBindingListener) {
      HttpSessionBindingListener listener;
      listener = (HttpSessionBindingListener) oldValue;

      listener.valueUnbound(new HttpSessionBindingEvent(this,
                                                        name,
                                                        oldValue));
    }

    // Notify the attributes listeners
    ArrayList listeners = _manager.getAttributeListeners();
    if (listeners != null) {
      HttpSessionBindingEvent event;

      event = new HttpSessionBindingEvent(this, name, oldValue);

      for (int i = 0; i < listeners.size(); i++) {
        HttpSessionAttributeListener listener;
        listener = (HttpSessionAttributeListener) listeners.get(i);

        listener.attributeRemoved(event);
      }
    }
  }
View Full Code Here


        // Catch the user preferred language.
        PreferredLocale preferredLocale =  getPreferredLocale(getRequest());
        LocaleManager.lookup().setCurrentLocale(preferredLocale.asLocale());

        // Store a HttpBindingListener object to detect session expiration
        getRequest().getSession().setAttribute(SESSION_ATTRIBUTE_BIND_LISTENER, new HttpSessionBindingListener() {
            public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent) {
            }

            public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent) {
                for (int i = 0; i < listeners.length; i++) {
View Full Code Here

        for (int i = 0; i < listeners.length; i++) {
            ControllerListener listener = listeners[i];
            listener.initSession(getRequest(), getResponse());
        }
        // Store a HttpBindingListener object to detect session expiration
        getRequest().getSession().setAttribute(SESSION_ATTRIBUTE_BIND_LISTENER, new HttpSessionBindingListener() {
            public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent) {
            }

            public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent) {
                for (int i = 0; i < listeners.length; i++) {
View Full Code Here

        for (int i = 0; i < listeners.length; i++) {
            ControllerListener listener = listeners[i];
            listener.initSession(getRequest(), getResponse());
        }
        // Store a HttpBindingListener object to detect session expiration
        getRequest().getSession().setAttribute(SESSION_ATTRIBUTE_BIND_LISTENER, new HttpSessionBindingListener() {
            public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent) {
            }

            public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent) {
                for (int i = 0; i < listeners.length; i++) {
View Full Code Here

    {
        super.setAttribute(name, value);

        if (value instanceof HttpSessionBindingListener)
        {
            HttpSessionBindingListener listener = (HttpSessionBindingListener) value;
            HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, name);

            listener.valueBound(event);
        }
    }
View Full Code Here

    {
        super.setAttribute(name, value);

        if (value instanceof HttpSessionBindingListener)
        {
            HttpSessionBindingListener listener = (HttpSessionBindingListener) value;
            HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, name);

            listener.valueBound(event);
        }
    }
View Full Code Here

        return array;
    }

    protected void afterBound(String s, Object o) {
        if (o instanceof HttpSessionBindingListener) {
            HttpSessionBindingListener listener = (HttpSessionBindingListener) o;
            HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, s, o);
            listener.valueBound(event);
        }
    }
View Full Code Here

        }
    }

    protected void afterUnbound(String s, Object o) {
        if (o instanceof HttpSessionBindingListener) {
            HttpSessionBindingListener listener = (HttpSessionBindingListener) o;
            HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, s, o);
            listener.valueUnbound(event);
        }
    }
View Full Code Here

    // call value unbound where appropriate...
    for (Map.Entry<String, Object> entry : sessionData_.entrySet()) {
      Object value = entry.getValue();
      if (value instanceof HttpSessionBindingListener) {
        String name = entry.getKey();
        HttpSessionBindingListener hsbl = (HttpSessionBindingListener) value;
        hsbl.valueUnbound(new HttpSessionBindingEvent(this, name));
      }
    }
    sessionData_.clear();
  }
View Full Code Here

    public void removeAttribute() {
        SessionAttributes attributes = mock(SessionAttributes.class);
        SessionContext context = mock(SessionContext.class);
        HttpSessionAttributeListener listener = mock(HttpSessionAttributeListener.class);
        String removedName = "removed";
        HttpSessionBindingListener removedValue = mock(HttpSessionBindingListener.class);
       
        when(this.session.getAttributes()).thenReturn(attributes);
        when(this.session.getContext()).thenReturn(context);
        when(context.getSessionAttributeListeners()).thenReturn(Collections.singleton(listener));
       
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpSessionBindingListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.