public interface QueueSession
QueueSession provides a map-like facility for storing and retrieving arbitrary object ("attributes") by name. These attributes are shared among all QueueSession instances that are associated with the same communication channel (for example, an HTTPSession or a WebSocketChannel).
Modifier and Type | Method and Description |
---|---|
void |
addSessionEndListener(SessionEndListener listener)
Registers a listener that will notified when this session ends.
|
boolean |
endSession()
Closes this session and notifies the
SessionEndListener s (optional operation; not all QueueSession
implementations are closeable). |
<T> T |
getAttribute(Class<T> type,
String attribute)
Returns the value associated with the given key.
|
Collection<String> |
getAttributeNames()
Returns the names of all attributes within this session.
|
String |
getParentSessionId()
Returns the ID of the session this QueueSession wraps.
|
String |
getSessionId()
Returns the ID of this session, which uniquely identifies it within the scope of this client (or server for a
server side session).
|
boolean |
hasAttribute(String attribute)
Returns true if the specified attribute exists.
|
boolean |
isValid() |
Object |
removeAttribute(String attribute)
Removes the specified attribute from this session.
|
void |
setAttribute(String attribute,
Object value)
Associates the given value with the given key, replacing the existing value, if any, for the key.
|
String getSessionId()
String getParentSessionId()
boolean endSession()
SessionEndListener
s (optional operation; not all QueueSession
implementations are closeable).void setAttribute(String attribute, Object value)
See the class-level documentation for a note on the scope of these attributes.
attribute
- the name (key) of the attribute. Not null.value
- new value for attribute. Null is permitted.<T> T getAttribute(Class<T> type, String attribute)
See the class-level documentation for a note on the scope of these attributes.
T
- the typetype
- the type to attempt to cast the attribute's value toattribute
- the name (key) of the attribute. Not null.hasAttribute(String)
to test for the existence of a null-valued
attribute.Collection<String> getAttributeNames()
See the class-level documentation for a note on the scope of these attributes.
boolean hasAttribute(String attribute)
See the class-level documentation for a note on the scope of these attributes.
attribute
- the attribute name to search for.Object removeAttribute(String attribute)
See the class-level documentation for a note on the scope of these attributes.
attribute
- the name of the attribute to remove.void addSessionEndListener(SessionEndListener listener)
listener
- the listener to be notified at session end.boolean isValid()
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.