|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wings.session.Session
public class Session
This class represents a wingS session meaning an application user session instance.
Please do not mix this with a servlet HttpSession!
WingServlet servlet. It aggregates all per--user-session
data (mainly the root SFrames and provides some information about the client like the browser getUserAgent(),
the current character encoding getCharacterEncoding() or the used Locale getLocale().
| Field Summary | |
|---|---|
static String |
CHARACTER_ENCODING_PROPERTY
The property name of the sessions character encoding |
protected EventListenerList |
listenerList
Store here only weak references. |
static String |
LOCALE_PROPERTY
The property name of the locale |
static String |
LOOK_AND_FEEL_PROPERTY
The property name of the look&feel |
protected javax.servlet.http.HttpServletRequest |
servletRequest
|
protected javax.servlet.http.HttpServletResponse |
servletResponse
|
| Constructor Summary | |
|---|---|
Session()
|
|
| Method Summary | |
|---|---|
void |
addExitListener(SExitListener listener)
|
void |
addFrame(SFrame frame)
Describe addFrame method here. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Describe addPropertyChangeListener method here. |
void |
addRequestListener(SRequestListener listener)
|
boolean |
containsProperty(String key)
|
String |
createUniqueId()
Creates a session context unique ID, that can be used as an identifier, i.e. |
protected void |
destroy()
|
void |
exit()
Exit the current session and redirect to new application instance. |
void |
exit(String redirectAddress)
Exit the current session and redirect to other URL. |
protected void |
finalize()
|
CGManager |
getCGManager()
The CG manager is responsible to provide the renderer implementation (aka. |
String |
getCharacterEncoding()
The current character encoding used for the communication with the clients userAgent. |
SComponent |
getComponentByName(SContainer container,
String name)
Search in the given SContainer for the SComponent with the given name. |
SComponent |
getComponentByName(String name)
|
LowLevelEventDispatcher |
getDispatcher()
The low level event dispatcher is responsible for taking an HTTP request, parse it contents and delegate the so called low level events to the registered LowLevelEventListeners (i.e. |
DragAndDropManager |
getDragAndDropManager()
|
String |
getExitAddress()
|
SExitListener[] |
getExitListeners()
|
ExternalizeManager |
getExternalizeManager()
The Externalize manager is response to provide all Resource
via HTTP to the client. |
Set<SFrame> |
getFrames()
Describe frames method here. |
Locale |
getLocale()
The Locale of the current session. |
boolean |
getLocaleFromHeader()
Indicates if the wings session servlet should adopt the clients Locale provided by the browsers in the HTTP header. |
int |
getMaxContentLength()
Get the maximum content length (file size) for a post request. |
MenuManager |
getMenuManager()
|
Map |
getProperties()
Describe getProperties method here. |
Object |
getProperty(String key)
Gets the session property indicated by the specified key. |
Object |
getProperty(String key,
Object def)
Gets the session property indicated by the specified key. |
String |
getRedirectAddress()
|
ReloadManager |
getReloadManager()
The reload manager responsible for the component invalidation of the components contained in this wingS session. |
ResourceMapper |
getResourceMapper()
|
SFrame |
getRootFrame()
The root frame is the first shown frame. |
ScriptManager |
getScriptManager()
The Script manager collects scripts |
javax.servlet.ServletContext |
getServletContext()
The current servlet context provided by the underlying servlet container. |
javax.servlet.http.HttpServletRequest |
getServletRequest()
|
javax.servlet.http.HttpServletResponse |
getServletResponse()
The current HTTP servlet response which the framework will deliver after processing the current request. |
SessionStatistics |
getStatistics()
|
Locale[] |
getSupportedLocales()
Returns the locales, supported by this application. |
SToolTipManager |
getToolTipManager()
|
Browser |
getUserAgent()
Returns the current browser of the client detected by the User-Agent parameter of the initial HTTP request
for this user session. |
boolean |
hasDragAndDropManager()
|
void |
init(javax.servlet.http.HttpServletRequest request)
Detect user agent (userAgent). |
void |
init(javax.servlet.ServletConfig servletConfig,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Detect user agent (userAgent). |
protected void |
initMaxContentLength()
|
protected void |
initProps(javax.servlet.ServletConfig servletConfig)
Copy the init parameters. |
protected void |
initProps(javax.servlet.ServletContext servletContext)
|
void |
removeExitListener(SExitListener listener)
|
void |
removeFrame(SFrame frame)
Describe removeFrame method here. |
Object |
removeProperty(String key)
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Describe removePropertyChangeListener method here. |
void |
removeRequestListener(SRequestListener listener)
|
void |
setCharacterEncoding(String characterEncoding)
The current character encoding used for the communication with the clients userAgent. |
void |
setDndManager(DragAndDropManager dndManager)
|
void |
setLocale(Locale locale)
Sets the locale for this session. |
void |
setLocaleFromHeader(boolean adoptLocale)
Indicates if the wings session servlet should adopt the clients Locale provided by the browsers in the HTTP header. |
void |
setMaxContentLength(int l)
Set the maximum content length (file size) for a post request. |
Object |
setProperty(String key,
Object value)
Sets the session property indicated by the specified key. |
void |
setRedirectAddress(String redirectAddress)
|
void |
setReloadManager(ReloadManager reloadManager)
Override the current reload manager. |
void |
setResourceMapper(ResourceMapper resourceMapper)
|
void |
setSupportedLocales(Locale[] locales)
sets the locales, supported by this application. |
void |
setUserAgentFromRequest(javax.servlet.http.HttpServletRequest request)
Describe setUserAgentFromRequest method here. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LOCALE_PROPERTY
public static final String CHARACTER_ENCODING_PROPERTY
public static final String LOOK_AND_FEEL_PROPERTY
protected transient javax.servlet.http.HttpServletResponse servletResponse
protected transient javax.servlet.http.HttpServletRequest servletRequest
protected final EventListenerList listenerList
| Constructor Detail |
|---|
public Session()
| Method Detail |
|---|
public final SessionStatistics getStatistics()
public void init(javax.servlet.ServletConfig servletConfig,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException
servletConfig - a ServletConfig valuerequest - a HttpServletRequest valueresponse -
javax.servlet.ServletException - if an error occurs
public void init(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
request - a HttpServletRequest value
javax.servlet.ServletException - if an error occursprotected void initMaxContentLength()
protected void initProps(javax.servlet.ServletConfig servletConfig)
protected void initProps(javax.servlet.ServletContext servletContext)
public javax.servlet.http.HttpServletRequest getServletRequest()
public javax.servlet.http.HttpServletResponse getServletResponse()
public javax.servlet.ServletContext getServletContext()
public void setReloadManager(ReloadManager reloadManager)
reloadManager - You customized reload manager implementation.public ReloadManager getReloadManager()
DefaultReloadManager if no other reload
manager has been setpublic MenuManager getMenuManager()
public ExternalizeManager getExternalizeManager()
Resource
via HTTP to the client.
public ScriptManager getScriptManager()
public CGManager getCGManager()
public SToolTipManager getToolTipManager()
public Browser getUserAgent()
User-Agent parameter of the initial HTTP request
for this user session.
Browser object providing browser type, os type and
other informations from the HTTP User-Agent string.public void setUserAgentFromRequest(javax.servlet.http.HttpServletRequest request)
setUserAgentFromRequest method here.
request - a HttpServletRequest valuepublic LowLevelEventDispatcher getDispatcher()
LowLevelEventListeners (i.e. Buttons, etc.)
public void addFrame(SFrame frame)
addFrame method here.
frame - a SFrame valuepublic void removeFrame(SFrame frame)
removeFrame method here.
frame - a SFrame valuepublic Set<SFrame> getFrames()
frames method here.
Set valuepublic SFrame getRootFrame()
SFrame valuepublic SComponent getComponentByName(String name)
public SComponent getComponentByName(SContainer container,
String name)
container - The SContainer where you want to search for the SComponent with the given name.name - The Name of the SComponent
public final Map getProperties()
getProperties method here.
getProperties in interface PropertyServiceMap valuepublic Object getProperty(String key)
getProperty in interface PropertyServicekey - the name of the session property.
null if there is no property with that key.PropertyService.getProperties()
public Object getProperty(String key,
Object def)
getProperty in interface PropertyServicekey - the name of the session property.def - a default value.
PropertyService.getProperties()
public Object setProperty(String key,
Object value)
setProperty in interface PropertyServicekey - the name of the session property.value - the value of the session property.
null if it did not have one.PropertyService.getProperty(java.lang.String),
PropertyService.getProperty(java.lang.String, java.lang.Object)public boolean containsProperty(String key)
containsProperty in interface PropertyServicepublic Object removeProperty(String key)
removeProperty in interface PropertyServicepublic void addPropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
addPropertyChangeListener method here.
propertyName - a String valuelistener - a PropertyChangeListener value
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
removePropertyChangeListener method here.
propertyName - a String valuelistener - a PropertyChangeListener value
public void setLocale(Locale locale)
throws IllegalArgumentException
locale - the locale to be associated with this session.
IllegalArgumentExceptionpublic Locale getLocale()
Locale valuepublic final void setLocaleFromHeader(boolean adoptLocale)
adoptLocale - if true, try to determine, false ignorepublic final boolean getLocaleFromHeader()
public final void setSupportedLocales(Locale[] locales)
public final Locale[] getSupportedLocales()
public void setCharacterEncoding(String characterEncoding)
null then the current characterEncoding is determined by the current
session Locale via the charset.properties map.
characterEncoding - The charcterEncoding which should be enforces for this session (i.e. "utf-8"),
or null if it should be determined by the clients userAgent Locale.public String getCharacterEncoding()
null then the current characterEncoding is determined by the current
session Locale via the charset.properties map.
public String createUniqueId()
String valuepublic final int getMaxContentLength()
MultipartRequestpublic final void setMaxContentLength(int l)
l - size in kB (1024 Byte)MultipartRequestprotected void destroy()
public void exit(String redirectAddress)
exit() method, especially, if it is an application
that requires a login and thus handles sensitive information accessible
through the session. Usually, you will call this on behalf of an
event within an ActionListener.actionPerformed() like for
a pressed 'EXIT'-Button.
redirectAddress - the address, the userAgent is redirected after
removing this session. This must be a String
containing the complete URL (no relative URL)
to the place to be redirected. If 'null', nothing
happens.public void exit()
exit() method, especially, if it is an application
that requires an login and thus handles sensitive information accessible
through the session. Usually, you will call this on behalf of an
event within an ActionListener.actionPerformed() like for
a pressed 'EXIT'-Button.
public String getExitAddress()
public String getRedirectAddress()
public void setRedirectAddress(String redirectAddress)
public void addExitListener(SExitListener listener)
public void removeExitListener(SExitListener listener)
public SExitListener[] getExitListeners()
public void addRequestListener(SRequestListener listener)
public void removeRequestListener(SRequestListener listener)
protected void finalize()
finalize in class Objectpublic boolean hasDragAndDropManager()
public DragAndDropManager getDragAndDropManager()
public void setDndManager(DragAndDropManager dndManager)
public ResourceMapper getResourceMapper()
public void setResourceMapper(ResourceMapper resourceMapper)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||