flex.messaging
Class FlexContext

java.lang.Object
  extended by flex.messaging.FlexContext

public class FlexContext
extends Object

The FlexContext is a utility class that exposes the current execution context. It provides access to FlexSession and FlexClient instances associated with the current message being processed, as well as global context via the MessageBroker, ServletContext and ServletConfig for the application. Any, or all, of the properties exposed by this class may be null depending upon the current execution context so test for that before attempting to interact with them.


Method Summary
static FlexClient getFlexClient()
          The FlexClient for the current request.
static FlexSession getFlexSession()
          The FlexSession for the current request.
static javax.servlet.http.HttpServletRequest getHttpRequest()
          The HttpServletResponse for the current request if the request is via HTTP.
static javax.servlet.http.HttpServletResponse getHttpResponse()
          The HttpServletResponse for the current request if the request is via HTTP.
static javax.servlet.ServletConfig getServletConfig()
          The ServletConfig for the current request, uses the last known ServletConfig when the request is not via HTTP.
static javax.servlet.ServletContext getServletContext()
          The ServletContext for the current web application.
static javax.servlet.http.HttpServletRequest getTunnelHttpRequest()
          The HttpServletRequest for the current request if it is transporting a tunneled protocol.
static Principal getUserPrincipal()
          Returns the principal associated with the session or client depending on whether perClientauthentication is being used.
static boolean isMessageFromPeer()
          Indicates whether the current message being processed came from a server peer in a cluster.
static void setUserPrincipal(Principal userPrincipal)
          Sets the Principal on either the current FlexClient or FlexSession depending upon whether perClientAuthentication is in use.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHttpRequest

public static javax.servlet.http.HttpServletRequest getHttpRequest()
The HttpServletRequest for the current request if the request is via HTTP. Returns null if the client is using a non-HTTP channel. Available for users.


getHttpResponse

public static javax.servlet.http.HttpServletResponse getHttpResponse()
The HttpServletResponse for the current request if the request is via HTTP. Returns null if the using an non-HTTP channel. Available for users.


getTunnelHttpRequest

public static javax.servlet.http.HttpServletRequest getTunnelHttpRequest()
The HttpServletRequest for the current request if it is transporting a tunneled protocol. Returns null if the current request protocol it not tunneled. Available for users.


getServletConfig

public static javax.servlet.ServletConfig getServletConfig()
The ServletConfig for the current request, uses the last known ServletConfig when the request is not via HTTP. Available for users.


getServletContext

public static javax.servlet.ServletContext getServletContext()
The ServletContext for the current web application.


getFlexClient

public static FlexClient getFlexClient()
The FlexClient for the current request. Available for users.


getFlexSession

public static FlexSession getFlexSession()
The FlexSession for the current request. Available for users.


isMessageFromPeer

public static boolean isMessageFromPeer()
Indicates whether the current message being processed came from a server peer in a cluster.


getUserPrincipal

public static Principal getUserPrincipal()
Returns the principal associated with the session or client depending on whether perClientauthentication is being used. If the client has not authenticated the principal will be null.

Returns:
The principal associated with the session.

setUserPrincipal

public static void setUserPrincipal(Principal userPrincipal)
Sets the Principal on either the current FlexClient or FlexSession depending upon whether perClientAuthentication is in use.

Parameters:
userPrincipal - The principal to associate with the FlexClient or FlexSession depending upon whether perClientAuthentication is in use.


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/FlexContext.html