/*
@see com.ibm.wsspi.session.ISession#setAttribute(java.lang.Object, java.lang.Object, java.lang.Boolean)
768060
@Override
    public synchronized Object setAttribute(Object name, Object value, Boolean newIsListener) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
            StringBuffer sb = new StringBuffer("{").append(name).append(",");
            if (!SessionManagerConfig.isHideSessionValues()) {
                sb.append(value).append(",");
            }
            sb.append(newIsListener).append("} ").append(appNameAndIdString);
            LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[SET_ATTRIBUTE], sb.toString());
        }
        Object oldValue = _attributes.put(name, value);
        Boolean oldIsListener = (Boolean) _attributeNames.put(name, newIsListener);
        _storeCallback.sessionAttributeSet(this, name, oldValue, oldIsListener, value, newIsListener);
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            if (!SessionManagerConfig.isHideSessionValues()) {
                LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[SET_ATTRIBUTE], oldValue);
            } else {
                LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[SET_ATTRIBUTE]);
            }
        }
        return oldValue;
    }
778673
public void setAttribute(String name, Object attribute) {
        if (!_iSess.isValid())
            throw new IllegalStateException();
        if (null != attribute) {
            if (!(attribute instanceof HttpSessionBindingListener)) {
                _iSess.setAttribute(name, attribute, Boolean.FALSE);
            } else {
                _iSess.setAttribute(name, attribute, Boolean.TRUE);
            }
        } else {
            // attribute is null
            // if name is not null, remove it ... otherwise do nothing
            if (name != null) {
                _iSess.removeAttribute(name);
            }
        }
    }
1300113
@Override
    public void removeAttribute(String name) {
        final boolean bTrace = TraceComponent.isAnyTracingEnabled();
        if (bTrace && tc.isDebugEnabled()) {
            Tr.debug(tc, "removeAttribute: " + name);
        }
        if (isInvalid()) {
            throw new IllegalStateException("Session is invalid");
        }
        Object attr = this.attributes.remove(name);
        if (null == attr) {
            if (bTrace && tc.isDebugEnabled()) {
                Tr.debug(tc, "Attribute not found");
            }
            return;
        }
        HttpSessionBindingEvent event = null;
        if (attr instanceof HttpSessionBindingListener) {
            // this value wants to know when it's removed
            if (bTrace && tc.isDebugEnabled()) {
                Tr.debug(tc, "Notifying value; " + attr);
            }
            event = new HttpSessionBindingEvent(this, name, attr);
            ((HttpSessionBindingListener) attr).valueUnbound(event);
        }
        // List<HttpSessionAttributeListener> listeners = this.myConfig.getSessionAttributeListeners();
        // if (null != listeners) {
        // // notify any session-attribute listeners that were registered
        // // in the module configuration
        // if (null == event) {
        // event = new HttpSessionBindingEvent(this, name, attr);
        // }
        // for (HttpSessionAttributeListener listener : listeners) {
        // if (bTrace && tc.isDebugEnabled()) {
        // Tr.debug(tc, "Notifying listener: " + listener);
        // }
        // listener.attributeRemoved(event);
        // }
        // }
    }
323996
public void setAttributes (Attributes atts)
    {
        clear();
        length = atts.getLength();
        if (length > 0) {
            data = new String[length*5];
            for (int i = 0; i < length; i++) {
                data[i*5] = atts.getURI(i);
                data[i*5+1] = atts.getLocalName(i);
                data[i*5+2] = atts.getQName(i);
                data[i*5+3] = atts.getType(i);
                data[i*5+4] = atts.getValue(i);
            }
    }
    }
192460
public void setAttribute(Attribute attribute) {
		if (!updateMode) {
			originalAttrs.put(attribute);
		}
		else {
			updatedAttrs.put(attribute);
		}
	}
694649
protected void setSessionValue(final HttpServletRequest request, final String key,
      final Object value) {
    request.getSession(true).setAttribute(key, value);
  }
1010460
public void setAttribute(String key, Object value) {

        if (m_attributes == null) {
            m_attributes = new HashMap<String, Object>(4);
        }
        m_attributes.put(key, value);
    }
1352065
@Override
	public void setAttribute(final String name, Object value) {
		if (HttpContext.AUTHENTICATION_TYPE.equals(name)) {
			handleAuthenticationType(value);
		} else if (HttpContext.REMOTE_USER.equals(name)) {
			handleRemoteUser(value);
		}
		super.setAttribute(name, value);
	}
877955
@com.fasterxml.jackson.annotation.JsonProperty("errorAttribute")
    public void setErrorAttribute(String errorAttribute) {
        this.errorAttribute = errorAttribute;
    }
466240
public void setAttributeList (AttributeList atts)
    {
    int count = atts.getLength();

    clear();

    for (int i = 0; i < count; i++) {
        addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i));
    }
    }
1112052
@JsonIgnore
    public void setAttribute(final String key, final Object value) {
        attributes.put(key, CollectionUtils.toCollection(value, ArrayList.class));
    }
1338182
public void setAttribute(String key, Object attribute) {
		if(!isValid()) {
			throw new IllegalStateException("Can not bind object to session that has been invalidated!!");
		}
		if(key == null) {
			throw new NullPointerException("Name of attribute to bind cant be null!!!");
		}
		if(attribute == null) {
			throw new NullPointerException("Attribute that is to be bound cant be null!!!");
		}

		// Construct an event with the new value
		SipSessionBindingEvent event = null;

        // Call the valueBound() method if necessary
        if (attribute instanceof SipSessionBindingListener) {
            // Don't call any notification if replacing with the same value
            Object oldValue = getAttributeMap().get(key);
            if (attribute != oldValue) {
            	event = new SipSessionBindingEvent(this, key);
                try {
                    ((SipSessionBindingListener) attribute).valueBound(event);
                } catch (Throwable t){
                	logger.error("SipSessionBindingListener threw exception", t);
                }
            }
        }

		Object previousValue = this.getAttributeMap().put(key, attribute);

		if (previousValue != null && previousValue != attribute &&
	            previousValue instanceof SipSessionBindingListener) {
            try {
                ((SipSessionBindingListener) previousValue).valueUnbound
                    (new SipSessionBindingEvent(this, key));
            } catch (Throwable t) {
            	logger.error("SipSessionBindingListener threw exception", t);
            }
        }

		// Notifying Listeners of attribute addition or modification
		SipListeners sipListenersHolder = this.getSipApplicationSession().getSipContext().getListeners();
		List<SipSessionAttributeListener> listenersList = sipListenersHolder.getSipSessionAttributeListeners();
		if(listenersList.size() > 0) {
			if(event == null) {
				event = new SipSessionBindingEvent(this, key);
			}
			if (previousValue == null) {
				// This is initial, we need to send value bound event
				for (SipSessionAttributeListener listener : listenersList) {
					if(logger.isDebugEnabled()) {
						logger.debug("notifying SipSessionAttributeListener " + listener.getClass().getCanonicalName() + " of attribute added on key "+ key);
					}
					try {
						listener.attributeAdded(event);
					} catch (Throwable t) {
						logger.error("SipSessionAttributeListener threw exception", t);
					}
				}
			} else {
				for (SipSessionAttributeListener listener : listenersList) {
					if(logger.isDebugEnabled()) {
						logger.debug("notifying SipSessionAttributeListener " + listener.getClass().getCanonicalName() + " of attribute replaced on key "+ key);
					}
					try {
						listener.attributeReplaced(event);
					} catch (Throwable t) {
						logger.error("SipSessionAttributeListener threw exception", t);
					}
				}
			}
		}
	}
69251
public void setBooleanAttribute(String name, Boolean value) {
		ensureValue();
		Attribute attribute = new BooleanAttribute(value);
		attribute.setEditable(isEditable(name));
		getValue().getAllAttributes().put(name, attribute);
	}
1231351
public void setAttribute(String name, String value)
	{
		if (value != null)
			getElement().setAttribute(name, value);
		else
			getElement().removeAttribute(name);
	}
721637
public void setAttribute(String arg0, Object arg1) {
        // 321485
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"setAttribute", "this->"+this+": "+" name --> [" + arg0 + "],  value --> [" + arg1 + "]");
        }
        if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
            checkRequestObjectInUse();
        }
        //PM71991 START
        if(WCCustomProperties.REMOVE_ATTRIBUTE_FOR_NULL_OBJECT && arg1== null){
            if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  
                logger.logp(Level.FINE, CLASS_NAME,"setAttribute", "cannot set attribute with null value, remove the attribute -->"+arg0);
            }
            this.removeAttribute(arg0);
        }
        else{//PM71991 END
            Object oldValue = _srtRequestHelper._attributes.put(arg0, arg1);

            if (oldValue != null) {
                this.attributeReplaced(arg0, oldValue);
            } else {
                this.attributeAdded(arg0, arg1);
            }
        }

    }
1083762
@Override
    public BaseJsonBo setAttribute(String attrName, Object value, boolean triggerChange) {
        if (value instanceof JsonNode) {
            if (value instanceof NullNode || value instanceof MissingNode) {
                super.setAttribute(attrName, null, triggerChange);
            } else {
                super.setAttribute(attrName, value.toString(), triggerChange);
            }
        } else {
            JsonNode node = null;
            if (value instanceof String) {
                node = tryParseJson(value.toString());
            }
            node = node != null ? node : SerializationUtils.toJson(value);
            super.setAttribute(attrName, node.toString(), triggerChange);
        }
        return this;
    }
1180849
public static void setAttribute(String key, Object value) {
        assertInitialized();
        getAppFramework().setAttribute(key, value);
    }