org.apache.myfaces.orchestra.frameworkAdapter.jsf
Class JsfFrameworkAdapter

java.lang.Object
  extended by org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter
      extended by org.apache.myfaces.orchestra.frameworkAdapter.basic.BasicFrameworkAdapter
          extended by org.apache.myfaces.orchestra.frameworkAdapter.jsf.JsfFrameworkAdapter

public class JsfFrameworkAdapter
extends BasicFrameworkAdapter

An implementation of the FrameworkAdapter for JSF environments.

This class requires the JsfFrameworkAdapterFilter to be configured to run or every JSF request.

This class defaults to using a JsfConversationMessager instance.


Constructor Summary
JsfFrameworkAdapter(java.lang.String conversationMessager)
           
 
Method Summary
 boolean containsRequestAttribute(java.lang.String key)
           
 boolean containsRequestParameterAttribute(java.lang.String key)
           
 boolean containsSessionAttribute(java.lang.String key)
           
protected  ConversationMessager createDefaultConversationMessager()
           
 java.lang.Object getBean(java.lang.String name)
          Look in the request and session scopes for an entry with the specified name.
protected  javax.faces.context.FacesContext getFacesContext()
           
 java.lang.String getInitParameter(java.lang.String key)
          Return the global init parameter with the specified name.
 java.lang.Object getRequestAttribute(java.lang.String key)
          Get a request-scope variable.
protected  java.lang.String getRequestContextPath()
           
 java.lang.Object getRequestParameterAttribute(java.lang.String key)
          Get a value from the set of input parameters sent by the user as part of the request.
 java.lang.Object getSessionAttribute(java.lang.String key)
          Get a variable from the session-scope of the current user.
 void invokeNavigation(java.lang.String navigationName)
          Perform a redirect to the specified url.
 void redirect(java.lang.String url)
          Instruct the remote browser to fetch the specified URL.
 void setRequestAttribute(java.lang.String key, java.lang.Object value)
           
 void setSessionAttribute(java.lang.String key, java.lang.Object value)
           
 
Methods inherited from class org.apache.myfaces.orchestra.frameworkAdapter.basic.BasicFrameworkAdapter
beginRequest, createConversationMessager, endRequest
 
Methods inherited from class org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter
getConversationMessager, getCurrentInstance, prepare, setConversationMessager, setCurrentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsfFrameworkAdapter

public JsfFrameworkAdapter(java.lang.String conversationMessager)
Method Detail

createDefaultConversationMessager

protected ConversationMessager createDefaultConversationMessager()
Overrides:
createDefaultConversationMessager in class BasicFrameworkAdapter

getFacesContext

protected javax.faces.context.FacesContext getFacesContext()

getInitParameter

public java.lang.String getInitParameter(java.lang.String key)
Description copied from class: FrameworkAdapter
Return the global init parameter with the specified name. In most cases this is expected to return data from the ServletContext.

Overrides:
getInitParameter in class BasicFrameworkAdapter

getRequestParameterAttribute

public java.lang.Object getRequestParameterAttribute(java.lang.String key)
Description copied from class: FrameworkAdapter
Get a value from the set of input parameters sent by the user as part of the request.

Overrides:
getRequestParameterAttribute in class BasicFrameworkAdapter

containsRequestParameterAttribute

public boolean containsRequestParameterAttribute(java.lang.String key)
Overrides:
containsRequestParameterAttribute in class BasicFrameworkAdapter

getRequestAttribute

public java.lang.Object getRequestAttribute(java.lang.String key)
Description copied from class: FrameworkAdapter
Get a request-scope variable.

Overrides:
getRequestAttribute in class BasicFrameworkAdapter

setRequestAttribute

public void setRequestAttribute(java.lang.String key,
                                java.lang.Object value)
Overrides:
setRequestAttribute in class BasicFrameworkAdapter

containsRequestAttribute

public boolean containsRequestAttribute(java.lang.String key)
Overrides:
containsRequestAttribute in class BasicFrameworkAdapter

getSessionAttribute

public java.lang.Object getSessionAttribute(java.lang.String key)
Description copied from class: FrameworkAdapter
Get a variable from the session-scope of the current user.

Overrides:
getSessionAttribute in class BasicFrameworkAdapter

setSessionAttribute

public void setSessionAttribute(java.lang.String key,
                                java.lang.Object value)
Overrides:
setSessionAttribute in class BasicFrameworkAdapter

containsSessionAttribute

public boolean containsSessionAttribute(java.lang.String key)
Overrides:
containsSessionAttribute in class BasicFrameworkAdapter

getRequestContextPath

protected java.lang.String getRequestContextPath()
Overrides:
getRequestContextPath in class BasicFrameworkAdapter

redirect

public void redirect(java.lang.String url)
              throws java.io.IOException
Description copied from class: FrameworkAdapter
Instruct the remote browser to fetch the specified URL.

Overrides:
redirect in class BasicFrameworkAdapter
Throws:
java.io.IOException

getBean

public java.lang.Object getBean(java.lang.String name)
Description copied from class: BasicFrameworkAdapter
Look in the request and session scopes for an entry with the specified name.

This basic adapter class does not support invoking the JSP expression evaluator; no "variable resolver" will ever be used to look up the specified name.

TODO: also look in the application scope.

TODO: investigate invoking the jsp.ExpressionFactory class to look up the variable. Possibly that could be done in a different JspFrameworkAdapter class.

Overrides:
getBean in class BasicFrameworkAdapter

invokeNavigation

public void invokeNavigation(java.lang.String navigationName)
Description copied from class: BasicFrameworkAdapter
Perform a redirect to the specified url.

A redirect is done rather than a forward so that the remote browser has its current url updated appropriately. Note that a redirect does cause any request-scoped variables to be discarded.

Overrides:
invokeNavigation in class BasicFrameworkAdapter


Copyright 2007 The Apache Software Foundation. All Rights Reserved.