org.tinygroup.weblayer.webcontext.session.impl
类 SessionWebContextImpl

java.lang.Object
  继承者 org.tinygroup.context.impl.BaseContextImpl
      继承者 org.tinygroup.context.impl.ContextImpl
          继承者 org.tinygroup.weblayer.webcontext.AbstractWebContextWrapper
              继承者 org.tinygroup.weblayer.webcontext.session.impl.SessionWebContextImpl
所有已实现的接口:
Serializable, org.tinygroup.context.BaseContext, org.tinygroup.context.Context, WebContext, SessionWebContext, TwoPhaseCommitWebContext

public class SessionWebContextImpl
extends AbstractWebContextWrapper
implements SessionWebContext

支持session的HttpRequestContext实现。

另请参见:
序列化表格

字段摘要
 
从类 org.tinygroup.context.impl.BaseContextImpl 继承的字段
itemMap
 
构造方法摘要
SessionWebContextImpl(WebContext wrappedContext, SessionConfig sessionConfig)
          构造函数。
 
方法摘要
 void clear()
          清除session。
 void clearSessionIDFromCookie()
          将session ID从Cookie中删除。
 void commit()
          结束一个请求。
 void commitHeaders()
          提交headers
 String decodeSessionIDFromCookie()
          从cookie中取得session ID。
 String decodeSessionIDFromURL()
          从URL中取得session ID。
 void encodeSessionIDIntoCookie()
          将session ID编码到Cookie中去。
 String encodeSessionIDIntoURL(String url)
          将session ID编码到URL中去。
 String getRequestedSessionID()
          取得当前的session ID。
 javax.servlet.http.HttpSession getSession(boolean create)
          取得当前的session,如果不存在,且createtrue,则创建一个新的。
 SessionConfig getSessionConfig()
          取得SessionConfig实例。
 boolean isRequestedSessionIDFromCookie()
          当前的session ID是从cookie中取得的吗?
 boolean isRequestedSessionIDFromURL()
          当前的session ID是从URL中取得的吗?
 boolean isRequestedSessionIDValid()
          判断当前的session ID是否仍然合法。
 boolean isSessionInvalidated()
          判断session是否已经作废。
 
从类 org.tinygroup.weblayer.webcontext.AbstractWebContextWrapper 继承的方法
get, getFromWrapperContext, getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, getWrappedWebContext, init, putSubWebContext, setObject, setRequest, setResponse, setServletContext
 
从类 org.tinygroup.context.impl.ContextImpl 继承的方法
clearSubContext, createSubContext, findNodeMap, get, getParent, getSubContext, getSubContextMap, put, putContext, putSubContext, remove, removeSubContext, renameKey, renameKeyNodeMap, setParent
 
从类 org.tinygroup.context.impl.BaseContextImpl 继承的方法
exist, get, getItemMap, put, remove, size
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 org.tinygroup.weblayer.WebContext 继承的方法
getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, init, setObject, setRequest, setResponse, setServletContext
 
从接口 org.tinygroup.context.Context 继承的方法
clearSubContext, createSubContext, get, getParent, getSubContext, getSubContextMap, put, putSubContext, remove, removeSubContext, setParent
 
从接口 org.tinygroup.context.BaseContext 继承的方法
exist, get, get, getItemMap, put, remove, renameKey, size
 

构造方法详细信息

SessionWebContextImpl

public SessionWebContextImpl(WebContext wrappedContext,
                             SessionConfig sessionConfig)
构造函数。

方法详细信息

getSessionConfig

public SessionConfig getSessionConfig()
取得SessionConfig实例。

指定者:
接口 SessionWebContext 中的 getSessionConfig
返回:
SessionConfig实例

isSessionInvalidated

public boolean isSessionInvalidated()
判断session是否已经作废。

指定者:
接口 SessionWebContext 中的 isSessionInvalidated
返回:
如已作废,则返回true

clear

public void clear()
清除session。类似invalidate()方法,但支持后续操作,而不会抛出 IllegalStateException

指定者:
接口 org.tinygroup.context.BaseContext 中的 clear
指定者:
接口 SessionWebContext 中的 clear
覆盖:
org.tinygroup.context.impl.ContextImpl 中的 clear

getRequestedSessionID

public String getRequestedSessionID()
取得当前的session ID。

返回:
session ID

isRequestedSessionIDFromCookie

public boolean isRequestedSessionIDFromCookie()
当前的session ID是从cookie中取得的吗?

返回:
如果是,则返回true

isRequestedSessionIDFromURL

public boolean isRequestedSessionIDFromURL()
当前的session ID是从URL中取得的吗?

返回:
如果是,则返回true

isRequestedSessionIDValid

public boolean isRequestedSessionIDValid()
判断当前的session ID是否仍然合法。

返回:
如果是,则返回true

encodeSessionIDIntoCookie

public void encodeSessionIDIntoCookie()
将session ID编码到Cookie中去。


clearSessionIDFromCookie

public void clearSessionIDFromCookie()
将session ID从Cookie中删除。


decodeSessionIDFromCookie

public String decodeSessionIDFromCookie()
从cookie中取得session ID。

返回:
如果存在,则返回session ID,否则返回null

encodeSessionIDIntoURL

public String encodeSessionIDIntoURL(String url)
将session ID编码到URL中去。

返回:
包含session ID的URL

decodeSessionIDFromURL

public String decodeSessionIDFromURL()
从URL中取得session ID。

返回:
如果存在,则返回session ID,否则返回null

getSession

public javax.servlet.http.HttpSession getSession(boolean create)
取得当前的session,如果不存在,且createtrue,则创建一个新的。

参数:
create - 必要时是否创建新的session
返回:
当前的session或新的session,如果不存在,且createfalse ,则返回null

commitHeaders

public void commitHeaders()
                   throws WebContextException
从接口 TwoPhaseCommitWebContext 复制的描述
提交headers

指定者:
接口 TwoPhaseCommitWebContext 中的 commitHeaders
抛出:
WebContextException

commit

public void commit()
结束一个请求。



Copyright © 2006–2013 开源组织. All rights reserved.