code: public synchronized void setContextAttribute(String name, Object value)
      {
          Object old= super.getContextAttribute(name);
          super.setContextAttribute(name, value);
  
          if (_contextAttributeListeners != null)
          {
              ServletContextAttributeEvent event=
                  new ServletContextAttributeEvent(getServletContext(), name, old != null ? old : value);
              for (int i= 0; i < LazyList.size(_contextAttributeListeners); i++)
              {
                  ServletContextAttributeListener l=
                      (ServletContextAttributeListener)LazyList.get(_contextAttributeListeners, i);
                  if (old == null)
                      l.attributeAdded(event);
                  else
                      if (value == null)
                          l.attributeRemoved(event);
                      else
                          l.attributeReplaced(event);
              }
          }
      }
docs: /* ------------------------------------------------------------