* Loads the object from the input stream.
*/
public void load(SessionDeserializer in)
throws IOException
{
HttpSessionEvent event = null;
ArrayList<HttpSessionActivationListener> listeners = null;
synchronized (this) {
synchronized (_values) {
// server/017u
_values.clear();
// unbind();
try {
int size = in.readInt();
//System.out.println("LOAD: " + size + " " + this + " " + _clusterObject + System.identityHashCode(this));
for (int i = 0; i < size; i++) {
String key = (String) in.readObject();
Object value = in.readObject();
if (value != null) {
_values.put(key, value);
if (value instanceof HttpSessionActivationListener) {
HttpSessionActivationListener listener
= (HttpSessionActivationListener) value;
if (event == null)
event = new HttpSessionEvent(this);
if (listeners == null)
listeners = new ArrayList<HttpSessionActivationListener>();
listeners.add(listener);
}
}
}
} catch (Exception e) {
throw IOExceptionWrapper.create(e);
}
}
}
for (int i = 0; listeners != null && i < listeners.size(); i++) {
HttpSessionActivationListener listener = listeners.get(i);
if (event == null)
event = new HttpSessionEvent(this);
listener.sessionDidActivate(event);
}
listeners = _manager.getActivationListeners();
for (int i = 0; listeners != null && i < listeners.size(); i++) {
HttpSessionActivationListener listener = listeners.get(i);
if (event == null)
event = new HttpSessionEvent(this);
listener.sessionDidActivate(event);
}
}