|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectwicket.Session
Holds information about a user session, including some fixed number of most recent pages (and all their nested component information).
RequestCycle
can be retrieved by calling RequestCycle.getSession().
Component.getSession(). As currently implemented, each Component
does not itself have a reference to the session that contains it. However,
the Page component at the root of the containment hierarchy does have a
reference to the Session that holds the Page. So
Component.getSession()traverses the component hierarchy to the root
Page and then calls Component.getSession().
setLocale(Locale). The Locale for a Session determines how
localized resources are found and loaded.
Applicationfor details). To discourage
non-typesafe access to Session properties, no setProperty() or getProperty()
method is provided.
IClassResolver) implementation that is used to locate classes for
components such as pages.
IPageFactory
is used to instantiate pages for the session.
| Field Summary | |
static java.lang.String |
sessionAttributeName
Name of session attribute under which this session is stored |
| Constructor Summary | |
protected |
Session(Application application)
Constructor. |
| Method Summary | |
protected void |
add(Page page)
Adds page to session if not already added. |
static Session |
get()
Get the session for the calling thread. |
Application |
getApplication()
Get the application that is currently working with this session. |
protected abstract java.lang.Object |
getAttribute(java.lang.String name)
|
protected abstract java.util.List |
getAttributeNames()
|
IClassResolver |
getClassResolver()
|
IConverter |
getConverter()
Gets the converter instance. |
java.util.Locale |
getLocale()
Get this session's locale. |
Page |
getPage(java.lang.String pageMapName,
java.lang.String path,
int versionNumber)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
IPageFactory |
getPageFactory()
|
IPageFactory |
getPageFactory(Page page)
|
PageMap |
getPageMap(java.lang.String pageMapName)
|
RequestCycle |
getRequestCycle()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
protected abstract IRequestCycleFactory |
getRequestCycleFactory()
|
java.lang.String |
getStyle()
Get the style (see Session). |
abstract void |
invalidate()
Invalidates this session |
PageMap |
newPageMap(java.lang.String name)
Creates a new page map with a given name |
protected PageState |
newPageState(Page page)
Gets a PageState record for a given Page. |
RequestCycle |
newRequestCycle(Request request,
Response response)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
remove(Page page)
Removes the given page from the cache. |
void |
removeAll()
Removes all pages from the session. |
protected abstract void |
removeAttribute(java.lang.String name)
|
static void |
set(Session session)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
setApplication(Application application)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
protected abstract void |
setAttribute(java.lang.String name,
java.lang.Object object)
|
void |
setLocale(java.util.Locale locale)
Set the locale for this session. |
void |
setRequestCycle(RequestCycle cycle)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
setStyle(java.lang.String style)
Set the style (see Session). |
void |
updateCluster()
Replicates this session to the cluster if it has changed. |
void |
updateSession()
Updates this session using changed state information that may have been replicated to this node on a cluster. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String sessionAttributeName
| Constructor Detail |
protected Session(Application application)
application - The application that this is a session of| Method Detail |
public static Session get()
public static void set(Session session)
Sets session for calling thread.
session - The sessionpublic final Application getApplication()
public final IClassResolver getClassResolver()
public final IConverter getConverter()
public java.util.Locale getLocale()
public final Page getPage(java.lang.String pageMapName, java.lang.String path, int versionNumber)
pageMapName - The name of the page map where the page ispath - Component pathversionNumber - The version of the page required
public final IPageFactory getPageFactory()
public final IPageFactory getPageFactory(Page page)
page - The page, or null if no page context is available
public final PageMap getPageMap(java.lang.String pageMapName)
pageMapName - Name of page map, or null for default page map
public final RequestCycle getRequestCycle()
public final java.lang.String getStyle()
public abstract void invalidate()
public final PageMap newPageMap(java.lang.String name)
name - The name for the new page map
public final RequestCycle newRequestCycle(Request request, Response response)
request - The requestresponse - The response
public final void remove(Page page)
page - The page to removepublic final void removeAll()
public final void setApplication(Application application)
Sets the application that this session is associated with.
application - The applicationpublic final void setLocale(java.util.Locale locale)
locale - New localepublic final void setRequestCycle(RequestCycle cycle)
cycle - The request cyclepublic final void setStyle(java.lang.String style)
Session).
style - The style to set.public void updateCluster()
public final void updateSession()
protected final void add(Page page)
page - Page to add to this sessionprotected abstract java.lang.Object getAttribute(java.lang.String name)
name - The name of the attribute to store
protected abstract java.util.List getAttributeNames()
protected abstract IRequestCycleFactory getRequestCycleFactory()
protected PageState newPageState(Page page)
page - The page
protected abstract void removeAttribute(java.lang.String name)
name - The name of the attribute to remove
protected abstract void setAttribute(java.lang.String name,
java.lang.Object object)
name - The name of the attribute to storeobject - The attribute value
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||