"WinstoneSession.AttributeNotSerializable", new String[] {
name, value.getClass().getName() }));
// valueBound must be before binding
if (value instanceof HttpSessionBindingListener) {
HttpSessionBindingListener hsbl = (HttpSessionBindingListener) value;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.webAppConfig.getLoader());
hsbl.valueBound(new HttpSessionBindingEvent(this, name, value));
Thread.currentThread().setContextClassLoader(cl);
}
Object oldValue = null;
synchronized (this.sessionMonitor) {
oldValue = this.sessionData.get(name);
if (value == null) {
this.sessionData.remove(name);
} else {
this.sessionData.put(name, value);
}
}
// valueUnbound must be after unbinding
if (oldValue instanceof HttpSessionBindingListener) {
HttpSessionBindingListener hsbl = (HttpSessionBindingListener) oldValue;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.webAppConfig.getLoader());
hsbl.valueUnbound(new HttpSessionBindingEvent(this, name, oldValue));
Thread.currentThread().setContextClassLoader(cl);
}
// Notify other listeners
if (oldValue != null)