Spring Framework AbstractRequestAttributes - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework AbstractRequestAttributes class.

This code example shows how to use the following methods:isRequestActive
	/** 
	 * Exposes the {@link PortletSession} that we're wrapping. 
	 * @param allowCreate whether to allow creation of a new session if none exists yet 
	 */ 
	protected final PortletSession getSession(boolean allowCreate) {
		if (isRequestActive()) { 
			return this.request.getPortletSession(allowCreate);
		} 
		else { 
			// Access through stored session reference, if any... 
			if (this.session == null && allowCreate) {
				throw new IllegalStateException(
						"No session found and request already completed - cannot create new session!"); 
			} 
			return this.session;
		} 
	} 
 
 
	@Override 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:registerRequestDestructionCallback
        return StringUtils.toStringArray(requestContext.getPropertyNames());
    } 
 
    @Override 
    public void registerDestructionCallback(String name, Runnable callback, int scope) {
        registerRequestDestructionCallback(name, callback);
    } 
 
    @Override 
    public Object resolveReference(String key) {
        if (REFERENCE_REQUEST.equals(key)) {
            return requestContext;
        } 
        return null; 
    } 
 
    @Override 
    public String getSessionId() {
        return null; 
    } 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:registerRequestDestructionCallback
		return attributesByScope.get(scope);
	} 
 
	@Override 
	public void registerDestructionCallback(String name, Runnable callback, int scope) {
		registerRequestDestructionCallback(name, callback);
	} 
 
	@Override 
	public Object resolveReference(String key) {
		return null; 
	} 
 
	@Override 
	public synchronized String getSessionId() {
		if (sessionId == null) {
			sessionId = UUID.randomUUID().toString();
		} 
		return sessionId;
	} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java