flex.messaging
Class HttpFlexSession

java.lang.Object
  extended by flex.messaging.util.TimeoutAbstractObject
      extended by flex.messaging.FlexSession
          extended by flex.messaging.HttpFlexSession
All Implemented Interfaces:
FlexClientListener, MessageClientListener, Serializable, EventListener, javax.servlet.http.HttpSessionAttributeListener, javax.servlet.http.HttpSessionBindingListener, javax.servlet.http.HttpSessionListener

public class HttpFlexSession
extends FlexSession
implements javax.servlet.http.HttpSessionBindingListener, javax.servlet.http.HttpSessionListener, javax.servlet.http.HttpSessionAttributeListener, Serializable

FlexSession implementation for use with HTTP-based channels.

See Also:
Serialized Form

Field Summary
static String SESSION_MAP
           
 
Fields inherited from class flex.messaging.FlexSession
FLEX_SESSION_LOG_CATEGORY
 
Method Summary
 void attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
          HttpSessionAttributeListener callback; processes the addition of an attribute to an HttpSession.
 void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
          HttpSessionAttributeListener callback; processes the removal of an attribute from an HttpSession.
 void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
          HttpSessionAttributeListener callback; processes the replacement of an attribute in an HttpSession.
 Object getAttribute(String name)
          Returns the attribute bound to the specified name in the session, or null if no attribute is bound under the name.
 Enumeration getAttributeNames()
          Returns the names of all attributes bound to the session.
static HttpFlexSession getFlexSession(javax.servlet.http.HttpServletRequest req)
          Creates or retrieves a FlexSession for the current Http request.
 String getId()
          Returns the Id for the session.
 Principal getUserPrincipal()
          Returns the user principal associated with the session.
 void invalidate()
          Invalidates the session.
 void removeAttribute(String name)
          Removes the attribute bound to the specified name in the session.
 void sessionCreated(javax.servlet.http.HttpSessionEvent event)
          Implements HttpSessionListener.
 void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
          Implements HttpSessionListener.
 void setAttribute(String name, Object value)
          Binds an attribute to the session under the specified name.
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
          Implements HttpSessionBindingListener.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
          Implements HttpSessionBindingListener.
 
Methods inherited from class flex.messaging.FlexSession
addSessionAttributeListener, addSessionCreatedListener, addSessionDestroyedListener, clearRemoteCredentials, getFlexClients, getMessageClients, getRemoteCredentials, isUserInRole, isValid, putRemoteCredentials, removeSessionAttributeListener, removeSessionCreatedListener, removeSessionDestroyedListener, setUserPrincipal, timeout
 
Methods inherited from class flex.messaging.util.TimeoutAbstractObject
cancelTimeout, getLastUse, getTimeoutFuture, getTimeoutManager, getTimeoutPeriod, getTimeoutTask, setLastUse, setTimeoutFuture, setTimeoutManager, setTimeoutPeriod, setTimeoutTask, updateLastUse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface flex.messaging.client.FlexClientListener
clientCreated, clientDestroyed
 
Methods inherited from interface flex.messaging.MessageClientListener
messageClientCreated, messageClientDestroyed
 

Field Detail

SESSION_MAP

public static final String SESSION_MAP
See Also:
Constant Field Values
Method Detail

attributeAdded

public void attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
HttpSessionAttributeListener callback; processes the addition of an attribute to an HttpSession. NOTE: Callback is not made against an HttpFlexSession associated with a request handling thread.

Specified by:
attributeAdded in interface javax.servlet.http.HttpSessionAttributeListener

attributeRemoved

public void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
HttpSessionAttributeListener callback; processes the removal of an attribute from an HttpSession. NOTE: Callback is not made against an HttpFlexSession associated with a request handling thread.

Specified by:
attributeRemoved in interface javax.servlet.http.HttpSessionAttributeListener

attributeReplaced

public void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
HttpSessionAttributeListener callback; processes the replacement of an attribute in an HttpSession. NOTE: Callback is not made against an HttpFlexSession associated with a request handling thread.

Specified by:
attributeReplaced in interface javax.servlet.http.HttpSessionAttributeListener

getFlexSession

public static HttpFlexSession getFlexSession(javax.servlet.http.HttpServletRequest req)
Creates or retrieves a FlexSession for the current Http request. The HttpFlexSession wraps the underlying J2EE HttpSession.

Parameters:
req - The Http request.
Returns:
The HttpFlexSession.

getUserPrincipal

public Principal getUserPrincipal()
Returns the user principal associated with the session. This will be null if the user has not authenticated.

Overrides:
getUserPrincipal in class FlexSession
Returns:
The Principal associated with the session.

invalidate

public void invalidate()
Invalidates the session.

Overrides:
invalidate in class FlexSession

getAttribute

public Object getAttribute(String name)
Returns the attribute bound to the specified name in the session, or null if no attribute is bound under the name.

Overrides:
getAttribute in class FlexSession
Parameters:
name - The name the target attribute is bound to.
Returns:
The attribute bound to the specified name.

getAttributeNames

public Enumeration getAttributeNames()
Returns the names of all attributes bound to the session.

Overrides:
getAttributeNames in class FlexSession
Returns:
The names of all attributes bound to the session.

getId

public String getId()
Returns the Id for the session.

Specified by:
getId in class FlexSession
Returns:
The Id for the session.

removeAttribute

public void removeAttribute(String name)
Removes the attribute bound to the specified name in the session.

Overrides:
removeAttribute in class FlexSession
Parameters:
name - The name of the attribute to remove.

sessionCreated

public void sessionCreated(javax.servlet.http.HttpSessionEvent event)
Implements HttpSessionListener. HttpSession created events are handled by setting an internal flag indicating that registration as an HttpSession listener was successful and we will be notified of session attribute changes and session destruction. NOTE: This method is not invoked against an HttpFlexSession associated with a request handling thread.

Specified by:
sessionCreated in interface javax.servlet.http.HttpSessionListener

sessionDestroyed

public void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
Implements HttpSessionListener. When an HttpSession is destroyed, the associated HttpFlexSession is also destroyed. NOTE: This method is not invoked against an HttpFlexSession associated with a request handling thread.

Specified by:
sessionDestroyed in interface javax.servlet.http.HttpSessionListener

setAttribute

public void setAttribute(String name,
                         Object value)
Binds an attribute to the session under the specified name.

Overrides:
setAttribute in class FlexSession
Parameters:
name - The name to bind the attribute under.
value - The attribute value.

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Implements HttpSessionBindingListener. This is a no-op. NOTE: This method is not invoked against an HttpFlexSession associated with a request handling thread.

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
Implements HttpSessionBindingListener. This callback will destroy the HttpFlexSession upon being unbound, only in the case where we haven't been registered as an HttpSessionListener in web.xml and can't shut down based on the HttpSession being invalidated. NOTE: This method is not invoked against an HttpFlexSession associated with a request handling thread.

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/HttpFlexSession.html