1 package org.mortbay.jetty.servlet.wadi; 2 3 import java.util.Map; 4 5 public interface WadiSession 6 { 7 8 /** 9 * Gets the sessionId. 10 * 11 * @return sessionId. 12 */ getSessionId()13 String getSessionId(); 14 15 /** 16 * Map like contract to manipulate state information. 17 */ addState(String key, Object value)18 Object addState(String key, Object value); 19 20 /** 21 * Map like contract to manipulate state information. 22 */ getState(String key)23 Object getState(String key); 24 25 /** 26 * Map like contract to manipulate state information. 27 */ removeState(String key)28 Object removeState(String key); 29 30 /** 31 * Map like contract to manipulate state information. 32 * <p> 33 * The returned Map is mutable and is backed by the session. 34 */ getState()35 Map getState(); 36 37 /** 38 * Releases the session. 39 * <p> 40 * When a Session is released, it is released from the underlying set of SessionManagers. In other words, its 41 * sessionId is unknown and its state is permanently lost. After the release of a Session, the behavior of 42 * the other methods is undefined. 43 */ release()44 void release(); 45 46 /** 47 * Notifies the session that state accesses are now completed. 48 * <p> 49 * When state accesses end, the underlying local SessionManager may decide to replicate synchronously or 50 * asynchronously the current state to remote SessionManagers. 51 */ onEndAccess()52 void onEndAccess(); 53 } 54