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.jsf.JsfFrameworkAdapter

public class JsfFrameworkAdapter
extends FrameworkAdapter

An implementation of the FrameworkAdapter for JSF environments.

This class defaults to using a JsfConversationMessager instance.


Constructor Summary
JsfFrameworkAdapter(java.lang.String conversationMessagerClass)
           
 
Method Summary
 void beginRequest()
          This method should be invoked at the start of each JSF request cycle, before any Orchestra functionality is invoked.
 boolean containsRequestAttribute(java.lang.String key)
           
 boolean containsRequestParameterAttribute(java.lang.String key)
           
 boolean containsSessionAttribute(java.lang.String key)
           
protected  ConversationMessager createDefaultConversationMessager()
           
 void endRequest()
          This method should be invoked at the end of each JSF request cycle, after the last Orchestra functionality is invoked.
 java.lang.Object getBean(java.lang.String name)
          Return the variable with the specified name, or null if no such bean exists.
 java.lang.String getCurrentViewId()
          Return the current JSF viewId.
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)
          Navigate to the specified logical destination.
 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.FrameworkAdapter
createConversationMessager, 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 conversationMessagerClass)
Method Detail

beginRequest

public void beginRequest()
This method should be invoked at the start of each JSF request cycle, before any Orchestra functionality is invoked.

Since:
1.1

endRequest

public void endRequest()
This method should be invoked at the end of each JSF request cycle, after the last Orchestra functionality is invoked.

Since:
1.1

createDefaultConversationMessager

protected ConversationMessager createDefaultConversationMessager()

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.

Specified by:
getInitParameter in class FrameworkAdapter

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.

Specified by:
getRequestParameterAttribute in class FrameworkAdapter

containsRequestParameterAttribute

public boolean containsRequestParameterAttribute(java.lang.String key)
Specified by:
containsRequestParameterAttribute in class FrameworkAdapter

getRequestAttribute

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

Specified by:
getRequestAttribute in class FrameworkAdapter

setRequestAttribute

public void setRequestAttribute(java.lang.String key,
                                java.lang.Object value)
Specified by:
setRequestAttribute in class FrameworkAdapter

containsRequestAttribute

public boolean containsRequestAttribute(java.lang.String key)
Specified by:
containsRequestAttribute in class FrameworkAdapter

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.

Specified by:
getSessionAttribute in class FrameworkAdapter

setSessionAttribute

public void setSessionAttribute(java.lang.String key,
                                java.lang.Object value)
Specified by:
setSessionAttribute in class FrameworkAdapter

containsSessionAttribute

public boolean containsSessionAttribute(java.lang.String key)
Specified by:
containsSessionAttribute in class FrameworkAdapter

getRequestContextPath

protected java.lang.String getRequestContextPath()

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.

Specified by:
redirect in class FrameworkAdapter
Throws:
java.io.IOException

getBean

public java.lang.Object getBean(java.lang.String name)
Description copied from class: FrameworkAdapter
Return the variable with the specified name, or null if no such bean exists.

In frameworks that support "managed beans", ie creation of objects on demand then this may trigger the creation of the specified object. In frameworks that do not support this, then the lookup may just return null if no object with the specified name currently exists.

Note that no "property traversal" is required or expected; a name of "a.b.c" is NOT evaluated as "property c of property b of bean a", but as the bean with name 'a.b.c'.

Specified by:
getBean in class FrameworkAdapter

invokeNavigation

public void invokeNavigation(java.lang.String navigationName)
Description copied from class: FrameworkAdapter
Navigate to the specified logical destination.

For frameworks that have a built-in navigation system, that system should be invoked.

For frameworks with no logical navigation system, the navigationName is treated as a plain URL. Whether a FORWARD or a REDIRECT to this URL is perfomed is determined by the subclass.

Specified by:
invokeNavigation in class FrameworkAdapter

getCurrentViewId

public java.lang.String getCurrentViewId()
Return the current JSF viewId.

Null is returned if there is not yet a UIViewRoot set up for the current request.

Overrides:
getCurrentViewId in class FrameworkAdapter


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.