You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2007/02/27 11:34:22 UTC

svn commit: r512213 - in /myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion: conversation/ conversation/jsf/ conversation/jsf/components/ conversation/jsf/lib/ conversation/spring/ frameworkAdapter/ requestParameterProvider/ viewControl...

Author: imario
Date: Tue Feb 27 02:34:21 2007
New Revision: 512213

URL: http://svn.apache.org/viewvc?view=rev&rev=512213
Log:
added frameworkAdapter: this should make it possible to use the core conversation context with other web frameworks too.
Not yet configureable, at least anything has been put into a single place now

Added:
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/JsfConversationUtils.java   (contents, props changed)
      - copied, changed from r512172, myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapter.java   (with props)
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapterInterface.java   (with props)
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/JsfFrameworkAdapter.java   (with props)
Modified:
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/Conversation.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationContext.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationManager.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/_ConversationUtils.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/ConversationPhaseListener.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UIEndConversation.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UISeparateConversationContext.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/lib/EndConversationMethodBindingFacade.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextCloser.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextConversationInterceptor.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/_SpringUtils.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/requestParameterProvider/RequestParameterProviderManager.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerManager.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerManager.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/Conversation.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/Conversation.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/Conversation.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/Conversation.java Tue Feb 27 02:34:21 2007
@@ -27,21 +27,21 @@
 import java.util.TreeMap;
 
 /**
- * <p>
+ * <p/>
  * The conversation object
  * </p>
- * <p>
+ * <p/>
  * The container for all beans managed by this conversation.
  * </p>
- * <p>
+ * <p/>
  * There is a (not yet configureable) timeout which is responsible to destory
  * the conversation if it has not been accessed.
  * </p>
- * <p>
+ * <p/>
  * Beans implementing the {@link ConversationBindingListener} will receive a message
  * when removed from (e.g. during destroy) or added to the conversation
  * </p>
- * <p>
+ * <p/>
  * There are various ways how to get access to the conversation:
  * <ul>
  * <li>{@link Conversation#getCurrentInstance} if you are within a conversation</li>
@@ -152,7 +152,7 @@
 
 	/**
 	 * <p>Invalidate/End the conversation</p>
-	 * <p>
+	 * <p/>
 	 * If you are within a conversation (the conversation is active) this
 	 * will just queue the destroy to the next possible time.
 	 * A conversation is active if you are within a method of one of the
@@ -254,7 +254,7 @@
 
 	/**
 	 * <p>remove a bean from the conversation.</p>
-	 * <p>
+	 * <p/>
 	 * This will fire a {@link ConversationBindingEvent} if the bean implements the
 	 * {@link ConversationBindingListener} interface.
 	 * </p>

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationContext.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationContext.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationContext.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationContext.java Tue Feb 27 02:34:21 2007
@@ -27,7 +27,7 @@
 
 /**
  * <p>The ConversationContext handles all conversations within the current context</p>
- * <p>
+ * <p/>
  * Like the conversation this context has a timeout too which will end this context
  * if not accessed within the given timeout.
  * </p>
@@ -82,7 +82,7 @@
 			Conversation[] convArray = new Conversation[conversations.size()];
 			conversations.values().toArray(convArray);
 
-			for (int i = 0 ; i<convArray.length; i++)
+			for (int i = 0; i < convArray.length; i++)
 			{
 				Conversation conversation = convArray[i];
 				conversation.invalidate();
@@ -193,7 +193,7 @@
 			Conversation[] convArray = new Conversation[conversations.size()];
 			conversations.values().toArray(convArray);
 
-			for (int i = 0 ; i<convArray.length; i++)
+			for (int i = 0; i < convArray.length; i++)
 			{
 				Conversation conversation = convArray[i];
 

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationManager.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationManager.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationManager.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationManager.java Tue Feb 27 02:34:21 2007
@@ -22,6 +22,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.fusion.conversation.spring._SpringUtils;
+import org.apache.myfaces.fusion.frameworkAdapter.FrameworkAdapter;
 import org.apache.myfaces.fusion.requestParameterProvider.RequestParameterProviderManager;
 import org.apache.myfaces.shared_fusion.util.ClassUtils;
 import org.springframework.beans.factory.config.BeanDefinition;
@@ -29,8 +30,6 @@
 import org.springframework.context.ConfigurableApplicationContext;
 
 import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpSession;
 import java.io.IOException;
 import java.io.ObjectStreamException;
 import java.io.Serializable;
@@ -102,29 +101,16 @@
 	 */
 	public static ConversationManager getInstance()
 	{
-		FacesContext context = FacesContext.getCurrentInstance();
-		if (context == null)
-		{
-			throw new IllegalStateException("no faces context available");
-		}
-		return getInstance(context);
-	}
-
-	/**
-	 * Get the conversation manager
-	 */
-	public static ConversationManager getInstance(FacesContext context)
-	{
-		ConversationManager conversationManager = (ConversationManager) context.getExternalContext().getSessionMap().get(CONVERSATION_MANAGER_KEY);
+		ConversationManager conversationManager = (ConversationManager) FrameworkAdapter.getInstance().getSessionAttribute(CONVERSATION_MANAGER_KEY);
 		if (conversationManager == null)
 		{
 			conversationManager = createConversationManager();
 
 			// initialize environmental systems
-			RequestParameterProviderManager.getInstance(context).register(new ConversationRequestParameterProvider());
+			RequestParameterProviderManager.getInstance().register(new ConversationRequestParameterProvider());
 
 			// set mark
-			context.getExternalContext().getSessionMap().put(CONVERSATION_MANAGER_KEY, conversationManager);
+			FrameworkAdapter.getInstance().setSessionAttribute(CONVERSATION_MANAGER_KEY, conversationManager);
 		}
 
 		return conversationManager;
@@ -148,44 +134,18 @@
 	}
 
 	/**
-	 * Get the conversation manager from the http session. This will <b>not</b> create a conversation manager if none exists.
-	 */
-	public static ConversationManager getInstance(HttpSession session)
-	{
-		if (session == null)
-		{
-			return null;
-		}
-		return (ConversationManager) session.getAttribute(CONVERSATION_MANAGER_KEY);
-	}
-
-	/**
 	 * Get the current, or create a new unique conversationContextId.<br />
 	 * The current conversationContextId will retrieved from the request parameters, if we cant find it there
 	 * a new one will be created. In either case the result will be stored within the request for faster lookup.
 	 */
 	public Long getConversationContextId()
 	{
-		Map requestMap;
-		Map requestParameterMap;
-
-		FacesContext context = FacesContext.getCurrentInstance();
-		if (context != null)
-		{
-			requestMap = context.getExternalContext().getRequestMap();
-			requestParameterMap = context.getExternalContext().getRequestParameterMap();
-		}
-		else
-		{
-			throw new IllegalStateException("no facesContext");
-		}
-
-		Long conversationContextId = (Long) requestMap.get(CONVERSATION_CONTEXT_REQ);
+		Long conversationContextId = (Long) FrameworkAdapter.getInstance().getRequestAttribute(CONVERSATION_CONTEXT_REQ);
 		if (conversationContextId == null)
 		{
-			if (requestParameterMap.containsKey(CONVERSATION_CONTEXT_PARAM))
+			if (FrameworkAdapter.getInstance().containsRequestParameterAttribute(CONVERSATION_CONTEXT_PARAM))
 			{
-				String urlConversationContextId = requestParameterMap.get(CONVERSATION_CONTEXT_PARAM).toString();
+				String urlConversationContextId = FrameworkAdapter.getInstance().getRequestParameterAttribute(CONVERSATION_CONTEXT_PARAM).toString();
 				conversationContextId = new Long(Long.parseLong(urlConversationContextId, Character.MAX_RADIX));
 			}
 			else
@@ -197,7 +157,7 @@
 				}
 			}
 
-			requestMap.put(CONVERSATION_CONTEXT_REQ, conversationContextId);
+			FrameworkAdapter.getInstance().setRequestAttribute(CONVERSATION_CONTEXT_REQ, conversationContextId);
 		}
 
 		return conversationContextId;
@@ -241,7 +201,7 @@
 		Long conversationContextId = getConversationContextId();
 		if (conversationContextId == null)
 		{
-		    return;
+			return;
 		}
 
 		ConversationContext conversationContext = getConversationContext(conversationContextId);
@@ -253,7 +213,7 @@
 
 	/**
 	 * <p>Destroy the given conversation context</p>
-	 *
+	 * <p/>
 	 * <p>Notice: its assumed that the context is already been destroyed</p>
 	 */
 	protected void removeConversationContext(Long conversationContextId)
@@ -278,7 +238,7 @@
 
 	/**
 	 * Remove a conversation
-	 *
+	 * <p/>
 	 * <p>Notice: Its assumed that the conversation has already been invalidated</p>
 	 *
 	 * @see ConversationContext#removeConversation(String)
@@ -338,11 +298,10 @@
 	 */
 	public boolean hasConversationContext()
 	{
-		FacesContext context = FacesContext.getCurrentInstance();
-
 		return
-			(context.getExternalContext().getRequestMap().containsKey(CONVERSATION_CONTEXT_REQ) ||
-				context.getExternalContext().getRequestParameterMap().containsKey(CONVERSATION_CONTEXT_PARAM)) &&
+			(
+				FrameworkAdapter.getInstance().containsRequestAttribute(CONVERSATION_CONTEXT_REQ) ||
+					FrameworkAdapter.getInstance().containsRequestParameterAttribute(CONVERSATION_CONTEXT_REQ)) &&
 				getConversationContext() != null;
 	}
 
@@ -363,7 +322,7 @@
 	 */
 	protected void createMessager()
 	{
-		String conversationMessagerName = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(INIT_MESSAGER);
+		String conversationMessagerName = FrameworkAdapter.getInstance().getInitParameter(INIT_MESSAGER);
 		if (conversationMessagerName == null)
 		{
 			conversationMessager = new DefaultConversationMessager();
@@ -421,7 +380,7 @@
 	 */
 	public boolean isManagedBean(String beanName)
 	{
-		ConfigurableApplicationContext applicationContext = _SpringUtils.getApplicationContext();
+		ConfigurableApplicationContext applicationContext = FrameworkAdapter.getInstance().getApplicationContext();
 		ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
 
 		// XXX: Hack to get the real definition in case of scoped targets

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java Tue Feb 27 02:34:21 2007
@@ -23,7 +23,8 @@
 
 package org.apache.myfaces.fusion.conversation;
 
-import javax.faces.context.FacesContext;
+import org.apache.myfaces.fusion.frameworkAdapter.FrameworkAdapter;
+
 import java.io.IOException;
 
 /**
@@ -61,42 +62,20 @@
 		{
 			try
 			{
-				FacesContext context = FacesContext.getCurrentInstance();
-
 				StringBuffer redir = new StringBuffer();
 				if (redirectViewId.startsWith("/"))
 				{
 					redir.append(
-						context.getExternalContext().getRequestContextPath());
+						FrameworkAdapter.getInstance().getRequestContextPath());
 				}
 				redir.append(redirectViewId);
 
-				context.getExternalContext().redirect(redir.toString());
-				context.responseComplete();
+				FrameworkAdapter.getInstance().redirect(redir.toString());
 			}
 			catch (IOException e)
 			{
 				throw new RuntimeException(e);
 			}
-		}
-	}
-
-	/**
-	 * <p>if no conversation with name <code>conversationName</code> is active a navigation with
-	 * the given action will be issued</p>
-	 * <p>
-	 * Notice: optionally you can use the conversationName as "fromAction" in your faces-config.xml
-	 * </p>
-	 */
-	public static void ensureConversation(String conversationName, String action)
-	{
-		if (!ConversationManager.getInstance().hasConversation(conversationName))
-		{
-			FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(
-				FacesContext.getCurrentInstance(),
-				conversationName,
-				action
-			);
 		}
 	}
 }

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/_ConversationUtils.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/_ConversationUtils.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/_ConversationUtils.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/_ConversationUtils.java Tue Feb 27 02:34:21 2007
@@ -94,7 +94,7 @@
 	 */
 	public static void endAndRestartConversation(FacesContext context, String conversationName, Boolean restart, MethodBinding restartAction)
 	{
-		ConversationManager conversationManager = ConversationManager.getInstance(context);
+		ConversationManager conversationManager = ConversationManager.getInstance();
 		Conversation conversation = conversationManager.getConversation(conversationName);
 		if (conversation != null)
 		{

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/ConversationPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/ConversationPhaseListener.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/ConversationPhaseListener.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/ConversationPhaseListener.java Tue Feb 27 02:34:21 2007
@@ -27,7 +27,7 @@
 import java.util.Map;
 
 /**
- * <p>
+ * <p/>
  * Initializes the Conversation system
  * </p>
  */
@@ -71,7 +71,7 @@
 			if (!Boolean.TRUE.equals(sessionMap.get(SYSTEM_INITIALIZED)))
 			{
 				// ensure correct setup of system
-				ConversationManager.getInstance(event.getFacesContext());
+				ConversationManager.getInstance();
 
 				sessionMap.put(SYSTEM_INITIALIZED, Boolean.TRUE);
 			}

Copied: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/JsfConversationUtils.java (from r512172, myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java)
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/JsfConversationUtils.java?view=diff&rev=512213&p1=myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java&r1=512172&p2=myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/JsfConversationUtils.java&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/ConversationUtils.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/JsfConversationUtils.java Tue Feb 27 02:34:21 2007
@@ -21,70 +21,25 @@
  * under the License.
  */
 
-package org.apache.myfaces.fusion.conversation;
+package org.apache.myfaces.fusion.conversation.jsf;
+
+import org.apache.myfaces.fusion.conversation.ConversationManager;
 
 import javax.faces.context.FacesContext;
-import java.io.IOException;
 
 /**
  * Some helpers usable for public use
  */
-public final class ConversationUtils
+public final class JsfConversationUtils
 {
-	private ConversationUtils()
-	{
-	}
-
-	/**
-	 * <p>This will end and restart the given conversation</p>
-	 * <p>In contrast to {@link Conversation#invalidateAndRestart()} this
-	 * method returns a new instance of the "controller bean" for the given conversation</p>
-	 * <p>The "controller bean" is the one you configured in your spring config</p>
-	 */
-	public static Object invalidateAndRestart(Conversation conversation)
-	{
-		String name = conversation.getName();
-
-		Conversation newConversation = conversation.invalidateAndRestart();
-
-		return newConversation.getAttribute(name);
-	}
-
-	/**
-	 * <p>if no conversation with name <code>conversationName</code> is active a redirect to
-	 * <code>redirectViewId</code> will be issued.</p>
-	 * <p>If <code>redirectViewId</code> starts with an slash ('/') the context path will be added</p>
-	 */
-	public static void ensureConversationRedirect(String conversationName, String redirectViewId)
+	private JsfConversationUtils()
 	{
-		if (!ConversationManager.getInstance().hasConversation(conversationName))
-		{
-			try
-			{
-				FacesContext context = FacesContext.getCurrentInstance();
-
-				StringBuffer redir = new StringBuffer();
-				if (redirectViewId.startsWith("/"))
-				{
-					redir.append(
-						context.getExternalContext().getRequestContextPath());
-				}
-				redir.append(redirectViewId);
-
-				context.getExternalContext().redirect(redir.toString());
-				context.responseComplete();
-			}
-			catch (IOException e)
-			{
-				throw new RuntimeException(e);
-			}
-		}
 	}
 
 	/**
 	 * <p>if no conversation with name <code>conversationName</code> is active a navigation with
 	 * the given action will be issued</p>
-	 * <p>
+	 * <p/>
 	 * Notice: optionally you can use the conversationName as "fromAction" in your faces-config.xml
 	 * </p>
 	 */
@@ -99,4 +54,4 @@
 			);
 		}
 	}
-}
+}
\ No newline at end of file

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/JsfConversationUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/JsfConversationUtils.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/JsfConversationUtils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UIEndConversation.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UIEndConversation.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UIEndConversation.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UIEndConversation.java Tue Feb 27 02:34:21 2007
@@ -32,11 +32,11 @@
 import java.util.Collection;
 
 /**
- * <p>
+ * <p/>
  * End a conversation
  * </p>
- *
- * <p>
+ * <p/>
+ * <p/>
  * This will end a conversation AFTER the method invoked by the parent component.<br />
  * The common use for this tag is to be put as child into a commandLink or commandButton.
  * <pre>
@@ -45,8 +45,8 @@
  * &lt;/h:commandLink&gt;
  * </pre>
  * </p>
- *
- * <p>
+ * <p/>
+ * <p/>
  * The various parameter are:
  * <ul>
  * <li>onOutcome<br />

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UISeparateConversationContext.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UISeparateConversationContext.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UISeparateConversationContext.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/components/UISeparateConversationContext.java Tue Feb 27 02:34:21 2007
@@ -27,7 +27,7 @@
 
 /**
  * <p>Embedded links will start a new conversation context</p>
- * <p>
+ * <p/>
  * This will allow you to start a completely new context for conversations which
  * is the base for multi window awareness.
  * </p>

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/lib/EndConversationMethodBindingFacade.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/lib/EndConversationMethodBindingFacade.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/lib/EndConversationMethodBindingFacade.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/jsf/lib/EndConversationMethodBindingFacade.java Tue Feb 27 02:34:21 2007
@@ -99,7 +99,7 @@
 		}
 		catch (Throwable t)
 		{
-			ConversationManager conversationManager = ConversationManager.getInstance(context);
+			ConversationManager conversationManager = ConversationManager.getInstance();
 
 			if (errorOutcome != null)
 			{

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextCloser.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextCloser.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextCloser.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextCloser.java Tue Feb 27 02:34:21 2007
@@ -19,8 +19,8 @@
 
 package org.apache.myfaces.fusion.conversation.spring;
 
-import org.apache.myfaces.fusion.conversation.ConversationBindingListener;
 import org.apache.myfaces.fusion.conversation.ConversationBindingEvent;
+import org.apache.myfaces.fusion.conversation.ConversationBindingListener;
 
 public class PersistenceContextCloser implements ConversationBindingListener
 {

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextConversationInterceptor.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextConversationInterceptor.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextConversationInterceptor.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/PersistenceContextConversationInterceptor.java Tue Feb 27 02:34:21 2007
@@ -24,11 +24,11 @@
 import org.apache.myfaces.fusion.conversation.Conversation;
 
 /**
- * <p>
+ * <p/>
  * Maintain the persistence state
  * </p>
- *
- * <p>
+ * <p/>
+ * <p/>
  * The interceptor will create a new persistenceContext using the
  * {@link PersistenceContextFactory} if none exists.<br />
  * It will also bind/unbind it if required.<br />

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/SpringConversationScope.java Tue Feb 27 02:34:21 2007
@@ -22,10 +22,10 @@
 import org.aopalliance.aop.Advice;
 import org.apache.myfaces.fusion.conversation.Conversation;
 import org.apache.myfaces.fusion.conversation.ConversationAware;
+import org.apache.myfaces.fusion.conversation.ConversationBindingEvent;
 import org.apache.myfaces.fusion.conversation.ConversationBindingListener;
 import org.apache.myfaces.fusion.conversation.ConversationManager;
 import org.apache.myfaces.fusion.conversation.CurrentConversationAdvice;
-import org.apache.myfaces.fusion.conversation.ConversationBindingEvent;
 import org.springframework.aop.framework.ProxyFactory;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanFactory;
@@ -35,35 +35,33 @@
 import org.springframework.beans.factory.config.ConfigurableBeanFactory;
 import org.springframework.beans.factory.config.Scope;
 
-import javax.faces.context.FacesContext;
-
 /**
  * <p>adapts the conversation scope to a new spring scope</p>
  * <p>It will also apply any advice configured</p>
  * <p>A sample configuration for a conversation scope with persistence
  * <pre>
  * 	&lt;bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"&gt;
-		&lt;property name="scopes"&gt;
-			&lt;map&gt;
-				&lt;entry key="conversation"&gt;
-					&lt;bean class="org.apache.myfaces.fusion.conversation.spring.SpringConversationScope"&gt;
-						&lt;property name="advices"&gt;
-							&lt;list&gt;
-								&lt;ref bean="persistentContextConversationInterceptor" /&gt;
-							&lt;/list&gt;
-						&lt;/property&gt;
-					&lt;/bean&gt;
-				&lt;/entry&gt;
-			&lt;/map&gt;
-		&lt;/property&gt;
-	&lt;/bean&gt;
-
-	&lt;bean id="persistentContextConversationInterceptor" class="org.apache.myfaces.fusion.conversation.spring.PersistenceContextConversationInterceptor"&gt;
-		&lt;property name="persistenceContextFactory" ref="yourPersistentContextFactory" /&gt;
-	&lt;/bean&gt;
+ * &lt;property name="scopes"&gt;
+ * &lt;map&gt;
+ * &lt;entry key="conversation"&gt;
+ * &lt;bean class="org.apache.myfaces.fusion.conversation.spring.SpringConversationScope"&gt;
+ * &lt;property name="advices"&gt;
+ * &lt;list&gt;
+ * &lt;ref bean="persistentContextConversationInterceptor" /&gt;
+ * &lt;/list&gt;
+ * &lt;/property&gt;
+ * &lt;/bean&gt;
+ * &lt;/entry&gt;
+ * &lt;/map&gt;
+ * &lt;/property&gt;
+ * &lt;/bean&gt;
+ * <p/>
+ * &lt;bean id="persistentContextConversationInterceptor" class="org.apache.myfaces.fusion.conversation.spring.PersistenceContextConversationInterceptor"&gt;
+ * &lt;property name="persistenceContextFactory" ref="yourPersistentContextFactory" /&gt;
+ * &lt;/bean&gt;
  * </pre>
  * </p>
- * <p>
+ * <p/>
  * If no conversation exists for the given bean name a new one will be created.<br />
  * The beanName will also be the conversation name.
  * </p>
@@ -89,8 +87,7 @@
 	 */
 	public String getConversationId()
 	{
-		FacesContext facesContext = FacesContext.getCurrentInstance();
-		ConversationManager manager = ConversationManager.getInstance(facesContext);
+		ConversationManager manager = ConversationManager.getInstance();
 		if (manager.hasConversationContext())
 		{
 			return Long.toString(manager.getConversationContextId().longValue(), 10);
@@ -108,9 +105,7 @@
 	{
 		name = buildBeanName(name);
 
-		FacesContext facesContext = FacesContext.getCurrentInstance();
-
-		ConversationManager manager = ConversationManager.getInstance(facesContext);
+		ConversationManager manager = ConversationManager.getInstance();
 
 		// check if we have a conversation
 		if (!manager.hasConversation(name))
@@ -186,8 +181,7 @@
 	 */
 	protected Conversation getConversationForBean(String beanName)
 	{
-		FacesContext facesContext = FacesContext.getCurrentInstance();
-		ConversationManager manager = ConversationManager.getInstance(facesContext);
+		ConversationManager manager = ConversationManager.getInstance();
 		Conversation conversation = manager.getConversation(beanName);
 		return conversation;
 	}

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/_SpringUtils.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/_SpringUtils.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/_SpringUtils.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/conversation/spring/_SpringUtils.java Tue Feb 27 02:34:21 2007
@@ -18,13 +18,11 @@
  */
 package org.apache.myfaces.fusion.conversation.spring;
 
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
-import org.springframework.beans.factory.config.Scope;
+import org.apache.myfaces.fusion.frameworkAdapter.FrameworkAdapter;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.Scope;
+import org.springframework.context.ConfigurableApplicationContext;
 
-import javax.servlet.ServletContext;
-import javax.faces.context.FacesContext;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -38,22 +36,14 @@
 	{
 	}
 
-	public static ConfigurableApplicationContext getApplicationContext()
-	{
-		// TODO: What about portlets ?
-		ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
-
-		return (ConfigurableApplicationContext) WebApplicationContextUtils.getWebApplicationContext(servletContext);
-	}
-
 	public static Set getConversationManagedScopeNames()
 	{
-		ConfigurableApplicationContext applicationContext = getApplicationContext();
+		ConfigurableApplicationContext applicationContext = FrameworkAdapter.getInstance().getApplicationContext();
 		ConfigurableListableBeanFactory beanFactory = applicationContext.getBeanFactory();
 
 		Set managedScopes = new TreeSet();
 		String[] scopes = beanFactory.getRegisteredScopeNames();
-		for (int i = 0; i<scopes.length; i++)
+		for (int i = 0; i < scopes.length; i++)
 		{
 			String scopeName = scopes[i];
 

Added: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapter.java?view=auto&rev=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapter.java (added)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapter.java Tue Feb 27 02:34:21 2007
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007, Your Corporation. All Rights Reserved.
+ */
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.fusion.frameworkAdapter;
+
+/**
+ * Provides access to the FrameworkAdapter so
+ */
+public class FrameworkAdapter
+{
+	private final static FrameworkAdapterInterface INSTANCE = new JsfFrameworkAdapter();
+
+	private FrameworkAdapter()
+	{
+	}
+
+	public static FrameworkAdapterInterface getInstance()
+	{
+		return INSTANCE;
+	}
+
+}

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapterInterface.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapterInterface.java?view=auto&rev=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapterInterface.java (added)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapterInterface.java Tue Feb 27 02:34:21 2007
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007, Your Corporation. All Rights Reserved.
+ */
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.fusion.frameworkAdapter;
+
+import org.springframework.context.ConfigurableApplicationContext;
+
+import java.io.IOException;
+
+/**
+ * The interface a framework has to provide to make use of the conversation scope
+ */
+public interface FrameworkAdapterInterface
+{
+	public String getInitParameter(String key);
+
+	public Object getRequestParameterAttribute(String key);
+
+	public boolean containsRequestParameterAttribute(String key);
+
+	public Object getRequestAttribute(String key);
+
+	public void setRequestAttribute(String key, Object value);
+
+	public boolean containsRequestAttribute(String key);
+
+	public Object getSessionAttribute(String key);
+
+	public void setSessionAttribute(String key, Object value);
+
+	public boolean containsSessionAttribute(String key, Object value);
+
+	public String getRequestContextPath();
+
+	public ConfigurableApplicationContext getApplicationContext();
+
+	public void redirect(String url) throws IOException;
+}

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapterInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapterInterface.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/FrameworkAdapterInterface.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/JsfFrameworkAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/JsfFrameworkAdapter.java?view=auto&rev=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/JsfFrameworkAdapter.java (added)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/JsfFrameworkAdapter.java Tue Feb 27 02:34:21 2007
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2007, Your Corporation. All Rights Reserved.
+ */
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.fusion.frameworkAdapter;
+
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+import java.io.IOException;
+
+/**
+ * A JSF Implementation for the FrameworkAdapter
+ */
+public class JsfFrameworkAdapter implements FrameworkAdapterInterface
+{
+	protected FacesContext getFacesContext()
+	{
+		FacesContext context = FacesContext.getCurrentInstance();
+		if (context == null)
+		{
+			throw new IllegalStateException("no facesContext");
+		}
+		return context;
+	}
+
+	public String getInitParameter(String key)
+	{
+		FacesContext context = getFacesContext();
+
+		return context.getExternalContext().getInitParameter(key);
+	}
+
+	public Object getRequestParameterAttribute(String key)
+	{
+		FacesContext context = getFacesContext();
+
+		return context.getExternalContext().getRequestParameterMap().get(key);
+	}
+
+	public boolean containsRequestParameterAttribute(String key)
+	{
+		FacesContext context = getFacesContext();
+
+		return context.getExternalContext().getRequestParameterMap().containsKey(key);
+	}
+
+	public Object getRequestAttribute(String key)
+	{
+		FacesContext context = getFacesContext();
+
+		return context.getExternalContext().getRequestMap().get(key);
+	}
+
+	public void setRequestAttribute(String key, Object value)
+	{
+		FacesContext context = getFacesContext();
+
+		context.getExternalContext().getRequestMap().put(key, value);
+	}
+
+	public boolean containsRequestAttribute(String key)
+	{
+		FacesContext context = getFacesContext();
+
+		return context.getExternalContext().getRequestMap().containsKey(key);
+	}
+
+	public Object getSessionAttribute(String key)
+	{
+		FacesContext context = getFacesContext();
+
+		return context.getExternalContext().getSessionMap().get(key);
+	}
+
+	public void setSessionAttribute(String key, Object value)
+	{
+		FacesContext context = getFacesContext();
+
+		context.getExternalContext().getSessionMap().put(key, value);
+	}
+
+	public boolean containsSessionAttribute(String key, Object value)
+	{
+		FacesContext context = getFacesContext();
+
+		return context.getExternalContext().getSessionMap().containsKey(key);
+	}
+
+	public String getRequestContextPath()
+	{
+		FacesContext context = getFacesContext();
+
+		return context.getExternalContext().getRequestContextPath();
+	}
+
+	public ConfigurableApplicationContext getApplicationContext()
+	{
+		// TODO: What about portlets ?
+		ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
+
+		return (ConfigurableApplicationContext) WebApplicationContextUtils.getWebApplicationContext(servletContext);
+	}
+
+	public void redirect(String url) throws IOException
+	{
+		FacesContext context = getFacesContext();
+
+		context.getExternalContext().redirect(url);
+		context.responseComplete();
+	}
+}
\ No newline at end of file

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/JsfFrameworkAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/JsfFrameworkAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/frameworkAdapter/JsfFrameworkAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/requestParameterProvider/RequestParameterProviderManager.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/requestParameterProvider/RequestParameterProviderManager.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/requestParameterProvider/RequestParameterProviderManager.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/requestParameterProvider/RequestParameterProviderManager.java Tue Feb 27 02:34:21 2007
@@ -21,8 +21,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.fusion.frameworkAdapter.FrameworkAdapter;
 
-import javax.faces.context.FacesContext;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -48,23 +48,13 @@
 
 	public static RequestParameterProviderManager getInstance()
 	{
-		FacesContext context = FacesContext.getCurrentInstance();
-		if (context == null)
-		{
-			throw new IllegalStateException("no faces context available!");
-		}
-		return getInstance(context);
-	}
-
-	public static RequestParameterProviderManager getInstance(FacesContext context)
-	{
 		RequestParameterProviderManager manager =
-			(RequestParameterProviderManager) context.getExternalContext().getSessionMap().get(PARAMETER_PROVIDER_MANAGER_KEY);
+			(RequestParameterProviderManager) FrameworkAdapter.getInstance().getSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY);
 
 		if (manager == null)
 		{
 			manager = new RequestParameterProviderManager();
-			context.getExternalContext().getSessionMap().put(PARAMETER_PROVIDER_MANAGER_KEY, manager);
+			FrameworkAdapter.getInstance().setSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY, manager);
 		}
 
 		return manager;
@@ -148,12 +138,6 @@
 
 	public boolean isFilterCalled()
 	{
-		FacesContext context = FacesContext.getCurrentInstance();
-		if (context == null)
-		{
-			throw new IllegalStateException("no faces context available!");
-		}
-
-		return Boolean.TRUE.equals(context.getExternalContext().getRequestMap().get(RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED));
+		return Boolean.TRUE.equals(FrameworkAdapter.getInstance().getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED));
 	}
 }

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java Tue Feb 27 02:34:21 2007
@@ -24,7 +24,7 @@
 /**
  * <p>The abstract basis class you have to use as basis class for any custom view controller executor.</p>
  * <p>Notice: This interface can be extended between releases, thats why its an abstract class instead of an interface.
- * New methods not implemented by your custom excecutor will not harm your system that way.</p> 
+ * New methods not implemented by your custom excecutor will not harm your system that way.</p>
  */
 public abstract class AbstractViewControllerExecutor
 {

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerManager.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerManager.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerManager.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerManager.java Tue Feb 27 02:34:21 2007
@@ -23,7 +23,7 @@
 import javax.faces.context.FacesContext;
 
 /**
- * <p>
+ * <p/>
  * The default {@link ViewControllerManager} which uses the {@link DefaultViewControllerNameMapper}
  * to map view-ids to bean names and the {@link ReflectiveViewControllerExecutor} to invoke
  * view controller events on your beans.

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java Tue Feb 27 02:34:21 2007
@@ -20,13 +20,13 @@
 
 package org.apache.myfaces.fusion.viewController;
 
-import java.util.Set;
-import java.util.HashSet;
 import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * <p>Map view-ids to bean names.</p>
- * <p>
+ * <p/>
  * The strategy of this mapper is as follows:
  * <ul>
  * <li>slash ('/') will be removed</li>
@@ -36,7 +36,7 @@
  * <li>result starting with an digit are prefixed too </li>
  * </ul>
  * </p>
- * <p>
+ * <p/>
  * Examples:
  * <table border="1">
  * <thead><tr><th>ViewId</th><th>BeanName</th></tr></thead>
@@ -74,7 +74,7 @@
 			return null;
 		}
 
-		boolean nextUpper=false;
+		boolean nextUpper = false;
 
 		StringBuffer sb = new StringBuffer(viewId);
 		for (int i = 0; i < sb.length(); i++)
@@ -84,7 +84,7 @@
 			{
 				if (i > 0)
 				{
-					nextUpper=true;
+					nextUpper = true;
 				}
 				sb.deleteCharAt(i);
 				i--;
@@ -97,7 +97,7 @@
 			else if (nextUpper)
 			{
 				sb.setCharAt(i, Character.toUpperCase(c));
-				nextUpper=false;
+				nextUpper = false;
 			}
 		}
 

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java Tue Feb 27 02:34:21 2007
@@ -26,7 +26,7 @@
 
 /**
  * <p>Invokes ViewController events using reflection.</p>
- * <p>
+ * <p/>
  * Your beans can optionally provide one of the following methods
  * <ul>
  * <li>public void initView()</li>

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java Tue Feb 27 02:34:21 2007
@@ -22,7 +22,7 @@
 
 /**
  * <p>The ViewController interface</p>
- * <p>
+ * <p/>
  * Your bean has to implement this interface if you've decided to use the {@link InterfaceViewControllerExecutor}
  * to get notifications
  * </p>

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerManager.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerManager.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerManager.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerManager.java Tue Feb 27 02:34:21 2007
@@ -25,7 +25,7 @@
 /**
  * <p>The view controller manager is basically a configuration class, you have to create your own if
  * you would like to use a different configuration</p>
- * <p>
+ * <p/>
  * If you would like to use your own naming scheme or executor just implement your own {@link ViewControllerManager} or
  * derive from {@link DefaultViewControllerManager} (the prefered way) and overload {@link #getViewControllerNameMapper()} or
  * {@link #getViewControllerExecutor()} }.<br />
@@ -36,9 +36,11 @@
  */
 public interface ViewControllerManager
 {
-	public final static String VIEW_CONTROLLER_MANAGER_NAME="fusion_ViewControllerManager";
+	public final static String VIEW_CONTROLLER_MANAGER_NAME = "fusion_ViewControllerManager";
 
 	public ViewControllerNameMapper getViewControllerNameMapper();
+
 	public AbstractViewControllerExecutor getViewControllerExecutor();
+
 	public Object getViewController(FacesContext facesContext, String viewId);
 }

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java?view=diff&rev=512213&r1=512212&r2=512213
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java Tue Feb 27 02:34:21 2007
@@ -20,11 +20,11 @@
 
 package org.apache.myfaces.fusion.viewController;
 
+import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseEvent;
 import javax.faces.event.PhaseId;
 import javax.faces.event.PhaseListener;
-import javax.faces.component.UIViewRoot;
 
 /**
  * <p>The phase listener dispatches some phases to the ViewController (your backing bean)</p>