/** * Performs the actual write of the VaadinSession to the underlying HTTP * session after sanity checks have been performed. * <p> * Called by {@link #storeSession(VaadinSession, WrappedSession)} * * @param wrappedSession * the underlying HTTP session * @param session * the VaadinSession to store */ protected void writeToHttpSession(WrappedSession wrappedSession, VaadinSession session) { wrappedSession.setAttribute(getSessionAttributeName(), session); }
/** * Associates the given lock with this service and the given wrapped * session. This method should not be called more than once when the lock is * initialized for the session. * * @param wrappedSession * The wrapped session the lock is associated with * @param lock * The lock object * @see #getSessionLock(WrappedSession) */ private void setSessionLock(WrappedSession wrappedSession, Lock lock) { if (wrappedSession == null) { throw new IllegalArgumentException( "Can't set a lock for a null session"); } Object currentSessionLock = wrappedSession .getAttribute(getLockAttributeName()); assert (currentSessionLock == null || currentSessionLock == lock) : "Changing the lock for a session is not allowed"; wrappedSession.setAttribute(getLockAttributeName(), lock); }
String name = entry.getKey(); Object value = entry.getValue(); newSession.setAttribute(name, value);