|
Eclipse Remote Application Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UISession
The UISession
represents the current instance of the UI.
In contrast to the HttpSession
it is possible to register a listener that is
notified before the session is destroyed. This listener can be used to cleanup on
session shutdown with the UI session still intact.
Method Summary | |
---|---|
boolean |
addSessionStoreListener(UISessionListener listener)
Deprecated. Use addUISessionListener instead |
boolean |
addUISessionListener(UISessionListener listener)
Adds a UISessionListener to this UI session. |
void |
exec(java.lang.Runnable runnable)
Executes the given runnable in the context of this UI session. |
ApplicationContext |
getApplicationContext()
Returns the ApplicationContext this UISession belongs to. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this UI session, or null if no
object is bound under the name. |
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Returns an Enumeration of the names of all objects bound to this UI session. |
Client |
getClient()
Returns a representation of the client that is connected with the server in this UI session. |
Connection |
getConnection()
Returns the connection used to communicate with the client that is connected to this UI session. |
HttpSession |
getHttpSession()
Returns the underlying HttpSession instance. |
java.lang.String |
getId()
Returns a unique identifier for this UI session. |
java.util.Locale |
getLocale()
Returns the preferred Locale for this UI session. |
boolean |
isBound()
Returns whether this UI session is bound to the underlying HttpSession or not. |
boolean |
removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this UI session. |
boolean |
removeSessionStoreListener(UISessionListener listener)
Deprecated. Use removeUISessionListener instead |
boolean |
removeUISessionListener(UISessionListener listener)
Removes a UISessionListener from this UI session. |
boolean |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this UI Session, using the name specified. |
void |
setLocale(java.util.Locale locale)
Sets the preferred Locale for this UI session. |
Method Detail |
---|
boolean setAttribute(java.lang.String name, java.lang.Object value)
If the value is null, this has the same effect as calling removeAttribute()
.
setAttribute
in interface ISessionStore
name
- the name to which the object is bound; cannot be null
value
- the object to be bound
true
if the attribute was set or false
if the attribute could
not be set because the session was invalidated.java.lang.Object getAttribute(java.lang.String name)
null
if no
object is bound under the name.
getAttribute
in interface ISessionStore
name
- a string specifying the name of the object; cannot be null
null
if no object is bound
with this nameboolean removeAttribute(java.lang.String name)
removeAttribute
in interface ISessionStore
name
- The name of the object to remove from this UI session, must not be
null
true
if the attribute was removed or false
if the attribute
could not be removed because the session was invalidatedisBound()
java.util.Enumeration<java.lang.String> getAttributeNames()
Enumeration
of the names of all objects bound to this UI session.
getAttributeNames
in interface ISessionStore
Enumeration
of strings that contains the names of all objects bound to
this UI session or an empty enumeration if the underlying session was invalidatedisBound()
java.lang.String getId()
getId
in interface ISessionStore
boolean addUISessionListener(UISessionListener listener)
UISessionListener
to this UI session. UISessionListener
s are
used to receive notifications before the UI session is destroyed. If the given listener is
already added the method has no effect.
listener
- the listener to be added
true
if the listener was added or false
if the listener could
not be added because the session was invalidatedisBound()
@Deprecated boolean addSessionStoreListener(UISessionListener listener)
addSessionStoreListener
in interface ISessionStore
boolean removeUISessionListener(UISessionListener listener)
UISessionListener
from this UI session. UISessionListener
s
are used to receive notifications before the UI session is destroyed. If the given listener is
not added to the session store this method has no effect.
listener
- the listener to be removed
true
if the listener was removed or false
if the listener
could not be removed because the session was invalidatedisBound()
@Deprecated boolean removeSessionStoreListener(UISessionListener listener)
removeSessionStoreListener
in interface ISessionStore
ApplicationContext getApplicationContext()
HttpSession getHttpSession()
getHttpSession
in interface ISessionStore
boolean isBound()
HttpSession
or not. If
the session store is unbound it behaves as if the HTTP session it belonged to was invalidated.
isBound
in interface ISessionStore
Client getClient()
null
Connection getConnection()
null
java.util.Locale getLocale()
Locale
for this UI session. The result reflects the locale
that has been set using setLocale(Locale)
. If no locale has been set on this
UISession, the locale will be taken from client using the ClientInfo
service. If the
client request doesn't provide a preferred locale, then this method returns the default locale
for the server.
null
setLocale(Locale)
void setLocale(java.util.Locale locale)
Locale
for this UI session. The value set can be retrieved
using getLocale()
.
locale
- the locale to set, or null
to resetgetLocale()
void exec(java.lang.Runnable runnable)
runnable
- the runnable to execute in the context of this UI sessionSingletonUtil
|
Eclipse Remote Application Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2013. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0