public Object get(Object instance, InstanceContext context) { Session session = getSession(); if (session == null) { return null; } return session.getAttribute(key); }
public String store(final String script) { Session session = request.getSession(true); String key = createKey(script); Integer max = 0; if ( session.getAttribute(key) != null ) { List<String> names = session.getAttributeNames(prefix); for ( String name : names ) { String[] parts = name.split("-"); Integer seq = new Integer(parts[1]); if ( seq > max ) { max = seq; } } } final String fkey = key + "-" + (max+1); session.setAttribute(fkey, script); return keyToUrl(fkey); }
public Object getAttributeValue() { return getSession().getAttribute(attributeName); }
public final Collection<PersistentFieldChange> gatherFieldChanges(String pageName) { Session session = request.getSession(false); if (session == null) return Collections.emptyList(); List<PersistentFieldChange> result = newList(); String fullPrefix = prefix + pageName + ":"; for (String name : session.getAttributeNames(fullPrefix)) { Object persistedValue = session.getAttribute(name); Object applicationValue = persistedValue == null ? null : convertPersistedToApplicationValue( persistedValue); PersistentFieldChange change = buildChange(name, applicationValue); result.add(change); didReadChange(session, name); } return result; }
protected final void train_getAttribute(Session session, String name, Object attribute) { expect(session.getAttribute(name)).andReturn(attribute); }
pw.write(name, session.getAttribute(name));
public String find(String path) { Session session = request.getSession(false); if(session != null){ String script = (String) session.getAttribute(path); session.setAttribute(path, null); return script; } return null; }
public <T> T getIfExists(Class<T> ssoClass) { Session session = request.getSession(false); if (session != null) { String key = buildKey(ssoClass); Object sso = session.getAttribute(key); return sso != null ? (T)sso : null; } return null; }
public <T> boolean exists(Class<T> ssoClass) { Session session = request.getSession(false); return session != null && !session.isInvalidated() && session.getAttribute(buildKey(ssoClass)) != null; } }
public String getPersistedEntityClassName() { final Session session = request.getSession(true); final Object value = session.getAttribute("sso:" + User.class.getName()); return value.getClass().getName(); } }
public String getPersistedEntityClassName() { final Session session = request.getSession(true); final Object value = session.getAttribute("sso:" + User.class.getName()); return value.getClass().getName(); } }
public String getPersistedEntityClassName() { Session session = request.getSession(true); Object value = session.getAttribute("sso:"+User.class.getName()); System.err.println("getPersistedEntityClassName(): "+value); return value.getClass().getName(); } }
public Track getAnotherTrack(){ return (Track) request.getSession(true).getAttribute("track_in_session"); } }
public Track getFavoriteTrack(){ return (Track) request.getSession(true).getAttribute("favoriteTrack"); }
protected <T> Object getOrCreate(Class<T> ssoClass, ApplicationStateCreator<T> creator) { Session session = getSession(); String key = buildKey(ssoClass); Object sso = session.getAttribute(key); if (sso == null) { sso = creator.create(); set(ssoClass, (T) sso); } return sso; }
assertSame(session.getAttribute("dirty"), dirty);