myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfreed...@apache.org
Subject svn commit: r1227359 [1/2] - in /myfaces/portlet-bridge/core/branches/refactored_3.0.x: ./ controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/ controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/ contro...
Date Wed, 04 Jan 2012 22:24:39 GMT
Author: mfreedman
Date: Wed Jan  4 22:24:38 2012
New Revision: 1227359

URL: http://svn.apache.org/viewvc?rev=1227359&view=rev
Log:
Refactored changes opening up internals as a set of configurable/replaceable modules.

Added:
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeConfigFactory.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeContextFactory.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeControllerFactory.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactory.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactoryFinder.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeLoggerFactory.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeFactory.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeManagerFactory.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/resources/META-INF/portlet2.0-bridge-controller-faces2.x-faces-config-extensions.xsd
Modified:
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfig.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContext.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeController.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeDestroyRequestSystemEvent.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeInitializeRequestSystemEvent.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConfigureSystemEvent.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConstructFacesContextSystemEvent.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePreReleaseFacesContextSystemEvent.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeSystemEvent.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLogger.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScope.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManager.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeUtil.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/examples/helloDuke/pom.xml
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/pom.xml
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/view/PortletJspViewDeclarationLanguageImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfigImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContextImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/PreFacesFacesContext.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeControllerImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLoggerImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManagerImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeRepository.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/util/config/FacesConfigurationProcessor.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/resources/META-INF/faces-config.xml
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/pom.xml

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfig.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfig.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfig.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfig.java Wed Jan  4 22:24:38 2012
@@ -10,7 +10,7 @@
  */
 
 
-package org.apache.myfaces.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.config;
 
 import java.util.List;
 
@@ -23,10 +23,12 @@ import javax.portlet.faces.BridgeEventHa
 import javax.portlet.faces.BridgePublicRenderParameterHandler;
 import javax.portlet.faces.BridgeWriteBehindResponse;
 
+import org.apache.myfaces.portlet.faces.bridge.logger.BridgeLogger;
+
 
 /**
  * The <CODE>BridgeConfig</CODE> represents the set of values a portlet can configure for
- * a given bridge instance. Currently, by spec, the portlet passes most of this 
+ * a given bridge instance. Currently, by spec, the portlet passes most of this
  * configuration to the bridge using <CODE>PortletContext</CODE> attributes.  The bridge,
  * in its <code>init()</code> method, is responsible for packaging all this configuration
  * information into a BridgeConfig.  It must then only reference such configuation information
@@ -122,6 +124,31 @@ public interface BridgeConfig
    *          parameter name that holds the bridge encoded target viewId.
    */  
   public String getViewIdRenderParameterName();
+  
+  /**
+   * Sets the name of the parameter used by the bridge to encode the target viewId when encoding 
+   * a Resource URL.  As resourceURLs can't impact render parameters and the resource request
+   * always receives the current render parameters, its we need a different parameter to hold
+   * this information.  This allows us to use its existence in the request as an indication 
+   * of whether the target is a Faces resource or a regular portlet one.
+   * 
+   * @param name
+   *          parameter name that holds the bridge encoded target viewId.
+   */
+  public void setViewIdResourceParameterName(String name);
+  
+  
+  /**
+   * Gets the name of the parameter used by the bridge to encode the target viewIdwhen encoding 
+   * a Resource URL.  As resourceURLs can't impact render parameters and the resource request
+   * always receives the current render parameters, its we need a different parameter to hold
+   * this information.  This allows us to use its existence in the request as an indication 
+   * of whether the target is a Faces resource or a regular portlet one.
+   * 
+   * @return
+   *          parameter name that holds the bridge encoded target viewId.
+   */  
+  public String getViewIdResourceParameterName();
    
   
   /**

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContext.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContext.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContext.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContext.java Wed Jan  4 22:24:38 2012
@@ -10,7 +10,7 @@
  */
 
 
-package org.apache.myfaces.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.context;
 
 import java.util.List;
 
@@ -25,6 +25,10 @@ import javax.portlet.faces.Bridge;
 import javax.portlet.faces.BridgeDefaultViewNotSpecifiedException;
 import javax.portlet.faces.BridgeInvalidViewPathException;
 
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScope;
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScopeManager;
+
 /**
  * The <CODE>BridgeContext</CODE> contains the runtime specific state the bridge
  * makes public so its various independent pieces can work together to properly

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeController.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeController.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeController.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeController.java Wed Jan  4 22:24:38 2012
@@ -8,12 +8,15 @@
  * 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.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.controller;
 
 import javax.portlet.faces.BridgeDefaultViewNotSpecifiedException;
 import javax.portlet.faces.BridgeException;
 import javax.portlet.faces.BridgeUninitializedException;
 
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
+
 
 public interface BridgeController 
 {

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeDestroyRequestSystemEvent.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeDestroyRequestSystemEvent.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeDestroyRequestSystemEvent.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeDestroyRequestSystemEvent.java Wed Jan  4 22:24:38 2012
@@ -8,13 +8,15 @@
  * 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.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.event;
+
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 
 
 /**
  * Faces <code>SystemEvent</code> sent by the Bridge in its <code>doFacesRequest()</code> method after
  * finishing request processing and just before it returns. Gives listeners
- * the ability to undo any work done in their own request initialization. 
+ * the ability to undo any work done in their own request initialization.
  */
 public class BridgeDestroyRequestSystemEvent extends BridgeSystemEvent
 {

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeInitializeRequestSystemEvent.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeInitializeRequestSystemEvent.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeInitializeRequestSystemEvent.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeInitializeRequestSystemEvent.java Wed Jan  4 22:24:38 2012
@@ -8,13 +8,15 @@
  * 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.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.event;
+
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 
 
 /**
  * Faces <code>SystemEvent</code> sent by the Bridge in its <code>doFacesRequest()</code> method after
  * acquiring the <code>BridgeContext</code> (and before doing anything else). Gives listeners
- * the ability to do their own request initialization and/or to augment the <code>BridgeContext</code>.  
+ * the ability to do their own request initialization and/or to augment the <code>BridgeContext</code>.
  * For example a listener could get the request or response from the <code>BridgeContext</code>,
  * wrap it to add their own overrides, and then put back into the <code>BridgeContext</code>.
  * Such use would ensure the wrapped request or response is what is used throughout the bridge's request processing.

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConfigureSystemEvent.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConfigureSystemEvent.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConfigureSystemEvent.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConfigureSystemEvent.java Wed Jan  4 22:24:38 2012
@@ -8,10 +8,12 @@
  * 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.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.event;
 
 import javax.faces.event.SystemEvent;
 
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+
 /**
  * Faces <code>SystemEvent</code> sent by the Bridge in its <code>init()</code> method after
  * initializing itself. Allows other extensions to also do any necessary

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConstructFacesContextSystemEvent.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConstructFacesContextSystemEvent.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConstructFacesContextSystemEvent.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePostConstructFacesContextSystemEvent.java Wed Jan  4 22:24:38 2012
@@ -8,14 +8,16 @@
  * 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.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.event;
+
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 
 /**
- * Faces <code>SystemEvent</code> sent by the Bridge in its <code>doFacesRequest()</code> method 
+ * Faces <code>SystemEvent</code> sent by the Bridge in its <code>doFacesRequest()</code> method
  * after the bridge has acquired the <code>FacesContext</code> but before it runs the <code>Lifecyle</code>.
  * Gives listeners the ability to do work at a point in which the entire request processing
  * environment has been established but before actually executing the request.  One use
- * allows <code>ExternalContext</code> implementations to be notified prior to use to do any 
+ * allows <code>ExternalContext</code> implementations to be notified prior to use to do any
  * initializations that couldn't be done in its constructor because it lacked access
  * to the <code>BridgeContext</code>.
  */

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePreReleaseFacesContextSystemEvent.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePreReleaseFacesContextSystemEvent.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePreReleaseFacesContextSystemEvent.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgePreReleaseFacesContextSystemEvent.java Wed Jan  4 22:24:38 2012
@@ -8,12 +8,14 @@
  * 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.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.event;
+
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 
 
 /**
  * Faces <code>SystemEvent</code> sent by the Bridge in its <code>doFacesRequest()</code> method after
- * executing the request and before releaing the <code>FacesContext</code>. 
+ * executing the request and before releaing the <code>FacesContext</code>.
  */
 public class BridgePreReleaseFacesContextSystemEvent extends BridgeSystemEvent
 {

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeSystemEvent.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeSystemEvent.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeSystemEvent.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/event/BridgeSystemEvent.java Wed Jan  4 22:24:38 2012
@@ -8,9 +8,10 @@
  * 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.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.event;
 
 import javax.faces.event.SystemEvent;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 
 /**
  * Base bridge <code>SystemEvent</code> class the provides access to the <code>BridgeContext</code>.

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeConfigFactory.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeConfigFactory.java?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeConfigFactory.java (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeConfigFactory.java Wed Jan  4 22:24:38 2012
@@ -0,0 +1,32 @@
+ /* 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.portlet.faces.bridge.factory;
+
+import javax.faces.FacesException;
+
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+
+
+public abstract class BridgeConfigFactory extends BridgeFactory<BridgeConfigFactory>
+{
+
+	public abstract BridgeConfig getBridgeConfig() throws FacesException;
+  
+
+}

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeContextFactory.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeContextFactory.java?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeContextFactory.java (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeContextFactory.java Wed Jan  4 22:24:38 2012
@@ -0,0 +1,32 @@
+ /* 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.portlet.faces.bridge.factory;
+
+import javax.faces.FacesException;
+import javax.faces.FacesWrapper;
+
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
+
+
+public abstract class BridgeContextFactory extends BridgeFactory<BridgeContextFactory>
+{
+
+	public abstract BridgeContext getBridgeContext() throws FacesException;
+
+}

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeControllerFactory.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeControllerFactory.java?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeControllerFactory.java (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeControllerFactory.java Wed Jan  4 22:24:38 2012
@@ -0,0 +1,35 @@
+ /* 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.portlet.faces.bridge.factory;
+
+import javax.faces.FacesException;
+
+import org.apache.myfaces.portlet.faces.bridge.controller.BridgeController;
+
+
+public abstract class BridgeControllerFactory extends BridgeFactory<BridgeControllerFactory>
+{
+
+	public abstract BridgeController getBridgeController() throws FacesException;
+
+	public BridgeControllerFactory getWrapped()
+  {
+		return null;
+	}
+}

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactory.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactory.java?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactory.java (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactory.java Wed Jan  4 22:24:38 2012
@@ -0,0 +1,39 @@
+ /* 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.portlet.faces.bridge.factory;
+
+import javax.faces.FacesException;
+import javax.faces.FacesWrapper;
+
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+
+
+public abstract class BridgeFactory<T> implements FacesWrapper<BridgeFactory>
+{
+  public BridgeFactory()
+  {
+
+  }
+
+	public BridgeFactory<T> getWrapped()
+  {
+		return null;
+	}
+  
+}

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactoryFinder.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactoryFinder.java?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactoryFinder.java (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeFactoryFinder.java Wed Jan  4 22:24:38 2012
@@ -0,0 +1,198 @@
+/* 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.portlet.faces.bridge.factory;
+
+import java.lang.reflect.Constructor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import java.util.Map;
+
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import javax.faces.FacesException;
+import javax.faces.FacesWrapper;
+
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.logger.BridgeLogger;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeFactory;
+
+public final class BridgeFactoryFinder
+{
+
+  private static Map<Class, List<String>> sFactoryDefinitions =
+    new HashMap<Class, List<String>>(6);
+  private static Map<Class, BridgeFactory<?>> sFactoryInstances =
+    new HashMap<Class, BridgeFactory<?>>(6);
+  private static ReentrantReadWriteLock sLock =
+    new ReentrantReadWriteLock(true);
+
+
+  public static void addFactoryDefinition(Class<? extends BridgeFactory> type,
+                                          String factoryImplClassName)
+  {
+    sLock.writeLock().lock();
+    try
+    {
+      List<String> defs = sFactoryDefinitions.get(type);
+      if (defs == null)
+      {
+        defs = (List<String>) new ArrayList(4);
+        sFactoryDefinitions.put(type, defs);
+      }
+      if (!defs.contains(factoryImplClassName))
+      {
+        defs.add(factoryImplClassName);
+      }
+    }
+    finally
+    {
+      sLock.writeLock().unlock();
+    }
+
+  }
+
+  public static List<String> getFactoryDefinition(Class<? extends BridgeFactory> type)
+  {
+    sLock.readLock().lock();
+    try
+    {
+      return sFactoryDefinitions.get(type);
+    }
+    finally
+    {
+      sLock.readLock().unlock();
+    }
+  }
+
+  public static void addFactoryInstance(Class<? extends BridgeFactory> type,
+                                        BridgeFactory<?> factoryInstance)
+  {
+    sLock.writeLock().lock();
+    try
+    {
+      sFactoryInstances.put(type, factoryInstance);
+    }
+    finally
+    {
+      sLock.writeLock().unlock();
+    }
+  }
+
+  public static BridgeFactory<?> getFactoryInstance(Class<? extends BridgeFactory> type)
+  {
+    sLock.readLock().lock();
+    try
+    {
+      BridgeFactory<?> instance = sFactoryInstances.get(type);
+      if (instance != null)
+      {
+        return instance;
+      }
+    }
+    finally
+    {
+      sLock.readLock().unlock();
+    }
+
+    // otherwise we need to instantiate it
+    sLock.writeLock().lock();
+    try
+    {
+      List<String> defs = getFactoryDefinition(type);
+
+      if (defs == null)
+      {
+        //TODO: log something
+        return null;
+      }
+      ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+      BridgeFactory<?> factoryInstance = null;
+      for (String s: defs)
+      {
+        factoryInstance =
+            getImplGivenPreviousImpl(cl, s, type, factoryInstance);
+      }
+      
+      // Now store instance in cache
+      addFactoryInstance(type, factoryInstance);
+      return factoryInstance;
+
+    }
+    finally
+    {
+      sLock.writeLock().unlock();
+    }
+
+  }
+
+  private static BridgeFactory<?> getImplGivenPreviousImpl(ClassLoader classLoader,
+                                                           String implName,
+                                                           Class<? extends BridgeFactory> type,
+                                                           Object previousImpl)
+  {
+    Class<? extends BridgeFactory> implClass = null;
+    Class[] constructorArgs;
+    Object[] newInstanceArgs = new Object[1];
+    Constructor constructor;
+
+    // if we have a previousImpl and the appropriate one arg ctor.
+    if (previousImpl != null)
+    {
+      try
+      {
+        implClass = (Class<? extends BridgeFactory>) Class.forName(implName, false, classLoader);
+        constructorArgs = new Class[1];
+        constructorArgs[0] = type;
+        constructor = implClass.getConstructor(constructorArgs);
+        newInstanceArgs[0] = previousImpl;
+        return (BridgeFactory<?>) constructor.newInstance(newInstanceArgs);
+      }
+      catch (NoSuchMethodException nsme)
+      {
+        // fall through to "zero-arg-ctor" case
+        ;
+      }
+      catch (Exception e)
+      {
+        throw new FacesException(implName, e);
+      }
+    }
+
+    // zero arg constructor
+    try
+    {
+      if (implClass == null)
+      {
+        implClass = (Class<? extends BridgeFactory>) Class.forName(implName, false, classLoader);
+      }
+      // since this is the hard coded implementation default,
+      // there is no preceding implementation, so don't bother
+      // with a non-zero-arg ctor.
+      return implClass.newInstance();
+    }
+    catch (Exception e)
+    {
+      throw new FacesException(implName, e);
+    }
+  }
+}

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeLoggerFactory.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeLoggerFactory.java?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeLoggerFactory.java (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeLoggerFactory.java Wed Jan  4 22:24:38 2012
@@ -0,0 +1,36 @@
+ /* 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.portlet.faces.bridge.factory;
+
+import javax.faces.FacesException;
+
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.logger.BridgeLogger;
+
+
+public abstract class BridgeLoggerFactory extends BridgeFactory<BridgeLoggerFactory>
+{
+
+	public abstract BridgeLogger getBridgeLogger(BridgeConfig config) throws FacesException;
+
+	public BridgeLoggerFactory getWrapped()
+  {
+		return null;
+	}
+}

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeFactory.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeFactory.java?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeFactory.java (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeFactory.java Wed Jan  4 22:24:38 2012
@@ -0,0 +1,43 @@
+ /* 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.portlet.faces.bridge.factory;
+
+import java.util.Map;
+
+import javax.faces.FacesException;
+
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScope;
+
+
+public abstract class BridgeRequestScopeFactory extends BridgeFactory<BridgeRequestScopeFactory>
+{
+
+	public abstract BridgeRequestScope getBridgeRequestScope(String portletId, String sessionId, String viewId, String portletMode) throws FacesException;
+  
+  public abstract BridgeRequestScope getBridgeRequestScope(String portletId, String sessionId, String viewId, String portletMode, int initialCapacity) throws FacesException;
+  
+  public abstract BridgeRequestScope getBridgeRequestScope(String portletId, String sessionId, String viewId, String portletMode, int initialCapacity, float loadFactor, int concurrencyLevel) throws FacesException;
+  
+  public abstract BridgeRequestScope getBridgeRequestScope(String portletId, String sessionId, String viewId, String portletMode, Map<String,Object> t) throws FacesException;
+
+	public BridgeRequestScopeFactory getWrapped()
+  {
+		return null;
+	}
+}

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeManagerFactory.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeManagerFactory.java?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeManagerFactory.java (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/factory/BridgeRequestScopeManagerFactory.java Wed Jan  4 22:24:38 2012
@@ -0,0 +1,36 @@
+ /* 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.portlet.faces.bridge.factory;
+
+import javax.faces.FacesException;
+
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScopeManager;
+
+
+public abstract class BridgeRequestScopeManagerFactory extends BridgeFactory<BridgeRequestScopeManagerFactory>
+{
+
+	public abstract BridgeRequestScopeManager getBridgeRequestScopeManager(BridgeConfig bConfig) throws FacesException;
+
+	public BridgeRequestScopeManagerFactory getWrapped()
+  {
+		return null;
+	}
+}

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLogger.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLogger.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLogger.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLogger.java Wed Jan  4 22:24:38 2012
@@ -10,7 +10,7 @@
  */
 
 
-package org.apache.myfaces.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.logger;
 
 
 

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScope.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScope.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScope.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScope.java Wed Jan  4 22:24:38 2012
@@ -10,7 +10,7 @@
  */
 
 
-package org.apache.myfaces.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.scope;
 
 import java.util.List;
 import java.util.concurrent.ConcurrentMap;

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManager.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManager.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManager.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManager.java Wed Jan  4 22:24:38 2012
@@ -10,7 +10,7 @@
  */
 
 
-package org.apache.myfaces.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.scope;
 
 import java.util.List;
 
@@ -19,6 +19,8 @@ import java.util.Map;
 import javax.portlet.PortletConfig;
 import javax.portlet.faces.BridgeWriteBehindResponse;
 
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
+
 /**
  * The RequestScopeManager manages a set of RequestScopes based on its desired policies.
  * Clients interact with this manager to create and remove request scopes and to lookup

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeUtil.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeUtil.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeUtil.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeUtil.java Wed Jan  4 22:24:38 2012
@@ -10,7 +10,7 @@
  */
 
 
-package org.apache.myfaces.portlet.faces.bridge;
+package org.apache.myfaces.portlet.faces.bridge.scope;
 
 import java.util.Iterator;
 import java.util.List;

Added: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/resources/META-INF/portlet2.0-bridge-controller-faces2.x-faces-config-extensions.xsd
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/resources/META-INF/portlet2.0-bridge-controller-faces2.x-faces-config-extensions.xsd?rev=1227359&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/resources/META-INF/portlet2.0-bridge-controller-faces2.x-faces-config-extensions.xsd (added)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/resources/META-INF/portlet2.0-bridge-controller-faces2.x-faces-config-extensions.xsd Wed Jan  4 22:24:38 2012
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+
+  <!-- elements that can be added under the <application-extension> element in the <application> section
+       define specific bridge behaviors. -->
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://myfaces.apache.org/portletbridge/controller" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  <!-- elements that can be added under the <factory-extension> element in the <factory> section
+       to define/plugin your bridge factory impls -->
+       
+<xs:element name="bridge-config-factory" type="xs:string" />     
+<xs:element name="bridge-context-factory" type="xs:string" />  
+<xs:element name="bridge-controller-factory" type="xs:string" />  
+<xs:element name="bridge-logger-factory" type="xs:string" />  
+<xs:element name="bridge-request-scope-factory" type="xs:string" />  
+<xs:element name="bridge-request-scope-manager-factory" type="xs:string" />  
+
+  
+</xs:schema>

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/examples/helloDuke/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/examples/helloDuke/pom.xml?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/examples/helloDuke/pom.xml (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/examples/helloDuke/pom.xml Wed Jan  4 22:24:38 2012
@@ -122,6 +122,15 @@
 <!-- sets up the webapp for deployment to pluto 2.0 (this is included as its the command in 1.0 for building to 2 - i.e. backwards compat) "mvn clean install -Ppluto2" -->    
     <profile>
       <id>pluto2</id>
+      <dependencies>
+        <dependency>
+           <groupId>org.slf4j</groupId>
+           <artifactId>slf4j-jcl</artifactId>
+           <version>${slf4j.version}</version>
+	     <scope>runtime</scope>
+        </dependency>
+
+      </dependencies>
       <build>
         <plugins>
           <plugin>

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/pom.xml?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/pom.xml (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/pom.xml Wed Jan  4 22:24:38 2012
@@ -47,6 +47,11 @@
       <groupId>com.sun.faces</groupId>
     </dependency>
 
+     <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
+     </dependency>
+
     <dependency>
       <artifactId>geronimo-annotation_1.0_spec</artifactId>
       <groupId>org.apache.geronimo.specs</groupId>
@@ -199,4 +204,5 @@
       </plugin>
     </plugins>
   </build>
+
 </project> 

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java Wed Jan  4 22:24:38 2012
@@ -37,14 +37,14 @@ import javax.portlet.faces.BridgeUtil;
 import javax.portlet.faces.annotation.PortletNamingContainer;
 import javax.portlet.faces.component.PortletNamingContainerUIViewRoot;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeContext;
-import org.apache.myfaces.portlet.faces.bridge.BridgeImpl;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
+
 
 /**
  * View handler implementation for JSF portlet bridge.
- * 
+ *
  * The only method we override here is getActionURL().
- * 
+ *
  * TODO JSF 1.2 note: JSF 1.2 RI implements ViewHandler.renderView() differently in order to handle
  * emitting non-JSF markup that follows the JSF tags after the JSF renders correctly. Unfortunately,
  * the RI handles this by introducing several servlet dependencies. Currently, the bridge handles

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/view/PortletJspViewDeclarationLanguageImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/view/PortletJspViewDeclarationLanguageImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/view/PortletJspViewDeclarationLanguageImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/application/view/PortletJspViewDeclarationLanguageImpl.java Wed Jan  4 22:24:38 2012
@@ -30,9 +30,7 @@ import javax.portlet.faces.BridgeUtil;
 
 import javax.portlet.faces.BridgeWriteBehindResponse;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeContext;
-import org.apache.myfaces.portlet.faces.bridge.BridgeImpl;
-import org.apache.myfaces.portlet.faces.util.QueryString;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 import org.apache.myfaces.shared_portlet.view.JspViewDeclarationLanguageBase;
 import org.apache.myfaces.shared_portlet.view.ViewResponseWrapper;
 
@@ -51,6 +49,9 @@ public class PortletJspViewDeclarationLa
   @Override
   public void buildView(FacesContext context, UIViewRoot view) throws IOException
   {
+    // For JIRA PORTLETBRIDGE-140
+    super.buildView(context, view);
+    
     if(null == context)
     {
       //TODO: Localize Strings

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java Wed Jan  4 22:24:38 2012
@@ -51,11 +51,21 @@ import javax.portlet.faces.BridgePublicR
 import javax.portlet.faces.BridgeUninitializedException;
 import javax.portlet.faces.BridgeWriteBehindResponse;
 
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
 import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfigImpl;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 import org.apache.myfaces.portlet.faces.bridge.context.BridgeContextImpl;
 import org.apache.myfaces.portlet.faces.bridge.context.PreFacesFacesContext;
 
+import org.apache.myfaces.portlet.faces.bridge.controller.BridgeController;
 import org.apache.myfaces.portlet.faces.bridge.controller.BridgeControllerImpl;
+import org.apache.myfaces.portlet.faces.bridge.event.BridgeDestroyRequestSystemEvent;
+import org.apache.myfaces.portlet.faces.bridge.event.BridgeInitializeRequestSystemEvent;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeConfigFactory;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeContextFactory;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeControllerFactory;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeFactoryFinder;
+import org.apache.myfaces.portlet.faces.bridge.logger.BridgeLogger;
 import org.apache.myfaces.portlet.faces.util.config.FacesConfigurationProcessor;
 import org.apache.myfaces.portlet.faces.util.config.WebConfigurationProcessor;
 
@@ -182,7 +192,7 @@ public class BridgeImpl
   
   private boolean isFacesResourceRequest(BridgeContext bCtx)
   {
-    return (bCtx.getPortletRequest().getParameter(bCtx.getBridgeConfig().getViewIdRenderParameterName()) != null ||
+    return (bCtx.getPortletRequest().getParameter(bCtx.getBridgeConfig().getViewIdResourceParameterName()) != null ||
             bCtx.getPortletRequest().getParameter(Bridge.FACES_VIEW_ID_PARAMETER) != null ||
             bCtx.getPortletRequest().getParameter(Bridge.FACES_VIEW_PATH_PARAMETER) != null);
   }
@@ -205,7 +215,7 @@ public class BridgeImpl
   private BridgeConfig getBridgeConfig(PortletConfig config)
   {
     // TODO: Use factory mechanism to get a BridgeConfig object
-    BridgeConfig bConfig = new BridgeConfigImpl();
+    BridgeConfig bConfig = ((BridgeConfigFactory) BridgeFactoryFinder.getFactoryInstance(BridgeConfigFactory.class)).getBridgeConfig();
        
     bConfig.setPortletConfig(config);
     
@@ -256,7 +266,7 @@ public class BridgeImpl
   private BridgeController getBridgeController(BridgeConfig bConfig)
   {
     // TODO -- use factory mechanism
-    BridgeController controller = new BridgeControllerImpl();
+    BridgeController controller = ((BridgeControllerFactory) BridgeFactoryFinder.getFactoryInstance(BridgeControllerFactory.class)).getBridgeController();
     controller.init(bConfig);
     return controller;
   }
@@ -264,7 +274,7 @@ public class BridgeImpl
   private BridgeContext getBridgeContext(PortletRequest request, PortletResponse response, Bridge.PortletPhase phase)
   {
     // TODO:  Use factory mechanism to create
-    BridgeContext bCtx = new BridgeContextImpl();
+    BridgeContext bCtx = ((BridgeContextFactory) BridgeFactoryFinder.getFactoryInstance(BridgeContextFactory.class)).getBridgeContext();
     
     bCtx.setBridgeConfig(mBridgeConfig);
     bCtx.setPortletContext(mBridgeConfig.getPortletConfig().getPortletContext());
@@ -361,17 +371,16 @@ public class BridgeImpl
   private void processFacesConfiguration(BridgeConfig config)
   {
     PortletContext context = config.getPortletConfig().getPortletContext();
-    FacesConfigurationProcessor processor = new FacesConfigurationProcessor(context);
     
     // Get the public render parameter mappings
-    config.setPublicRenderParameterMappings(processor.getPublicParameterMappings());
+    config.setPublicRenderParameterMappings(FacesConfigurationProcessor.getPublicParameterMappings());
     
     // Get the write-behind response wrapper mappings
-    config.setWriteBehindRenderResponseWrapper(validateWrapperClass(processor.getWriteBehindRenderResponseWrapperClassName()));
-    config.setWriteBehindResourceResponseWrapper(validateWrapperClass(processor.getWriteBehindResourceResponseWrapperClassName()));
+    config.setWriteBehindRenderResponseWrapper(validateWrapperClass(FacesConfigurationProcessor.getWriteBehindRenderResponseWrapperClassName()));
+    config.setWriteBehindResourceResponseWrapper(validateWrapperClass(FacesConfigurationProcessor.getWriteBehindResourceResponseWrapperClassName()));
     
     // Update the excluded attributes list
-    List<String> list = processor.getExcludedAttributes();
+    List<String> list = FacesConfigurationProcessor.getExcludedAttributes();
     List<String> existsingExcludes = config.getExcludedRequestAttributes();
     
     if (list != null)

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfigImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfigImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfigImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/config/BridgeConfigImpl.java Wed Jan  4 22:24:38 2012
@@ -31,8 +31,11 @@ import javax.portlet.faces.BridgeEventHa
 import javax.portlet.faces.BridgePublicRenderParameterHandler;
 import javax.portlet.faces.BridgeWriteBehindResponse;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeConfig;
-import org.apache.myfaces.portlet.faces.bridge.BridgeLogger;
+import org.apache.myfaces.portlet.faces.bridge.controller.BridgeController;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeControllerFactory;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeFactoryFinder;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeLoggerFactory;
+import org.apache.myfaces.portlet.faces.bridge.logger.BridgeLogger;
 import org.apache.myfaces.portlet.faces.bridge.logger.BridgeLoggerImpl;
 
 /**
@@ -49,11 +52,14 @@ import org.apache.myfaces.portlet.faces.
 public class BridgeConfigImpl implements BridgeConfig
 {
   public static final String JSF_TARGET_VIEWID_RENDER_PARAMETER = "__jpfbJSFTARGET";
+  public static final String JSF_TARGET_VIEWID_RESOURCE_PARAMETER = "__jpfbJSFResTARGET";
+
   
   private PortletConfig mPortletConfig;
   private ConcurrentHashMap<String, String> mDefaultMappings;
   private Vector<String> mFacesServletMappings;
   private String mViewIdParameterName = JSF_TARGET_VIEWID_RENDER_PARAMETER;
+  private String mViewIdResourceParameterName = JSF_TARGET_VIEWID_RESOURCE_PARAMETER;
   private BridgeLogger mLogger;
   private BridgeEventHandler mEventHandler;
   private BridgePublicRenderParameterHandler mPRPHandler;
@@ -198,6 +204,38 @@ public class BridgeConfigImpl implements
   {
     return mViewIdParameterName;
   }
+  
+  /**
+   * Sets the name of the parameter used by the bridge to encode the target viewId when encoding 
+   * a Resource URL.  As resourceURLs can't impact render parameters and the resource request
+   * always receives the current render parameters, its we need a different parameter to hold
+   * this information.  This allows us to use its existence in the request as an indication 
+   * of whether the target is a Faces resource or a regular portlet one.
+   * 
+   * @param name
+   *          parameter name that holds the bridge encoded target viewId.
+   */
+  public void setViewIdResourceParameterName(String name)
+  {
+    mViewIdResourceParameterName = name;
+  }
+  
+  
+  /**
+   * Gets the name of the parameter used by the bridge to encode the target viewIdwhen encoding 
+   * a Resource URL.  As resourceURLs can't impact render parameters and the resource request
+   * always receives the current render parameters, its we need a different parameter to hold
+   * this information.  This allows us to use its existence in the request as an indication 
+   * of whether the target is a Faces resource or a regular portlet one.
+   * 
+   * @return
+   *          parameter name that holds the bridge encoded target viewId.
+   */  
+  public String getViewIdResourceParameterName()
+  {
+    return mViewIdResourceParameterName;
+  }
+   
    
   
   /**
@@ -223,7 +261,7 @@ public class BridgeConfigImpl implements
     if (mLogger == null)
     {
       // TODO: use factory mechanism to create the logger
-      setLogger(new BridgeLoggerImpl(this));
+      setLogger(((BridgeLoggerFactory) BridgeFactoryFinder.getFactoryInstance(BridgeLoggerFactory.class)).getBridgeLogger(this));
     }
     return mLogger;
   }

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContextImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContextImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/BridgeContextImpl.java Wed Jan  4 22:24:38 2012
@@ -31,7 +31,6 @@ import javax.el.ELContextListener;
 import javax.faces.FactoryFinder;
 import javax.faces.application.ApplicationFactory;
 
-import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 
 import javax.faces.render.ResponseStateManager;
@@ -44,11 +43,15 @@ import javax.portlet.faces.Bridge;
 import javax.portlet.faces.BridgeDefaultViewNotSpecifiedException;
 import javax.portlet.faces.BridgeInvalidViewPathException;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeConfig;
-import org.apache.myfaces.portlet.faces.bridge.BridgeContext;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScope;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScopeManager;
-import org.apache.myfaces.portlet.faces.bridge.controller.BridgeControllerImpl;
+import javax.portlet.faces.BridgeUtil;
+
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeControllerFactory;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeFactoryFinder;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeRequestScopeFactory;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeRequestScopeManagerFactory;
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScope;
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScopeManager;
 import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScopeManagerImpl;
 import org.apache.myfaces.portlet.faces.el.PortletELContextImpl;
 import org.apache.myfaces.portlet.faces.util.QueryString;
@@ -719,7 +722,7 @@ public class BridgeContextImpl extends B
     BridgeRequestScopeManager scopeManager = (BridgeRequestScopeManager) mPortletContext.getAttribute(REQUEST_SCOPE_MANAGER);
     if (scopeManager == null)
     {
-      mPortletContext.setAttribute(REQUEST_SCOPE_MANAGER, new BridgeRequestScopeManagerImpl(mBridgeConfig));
+      mPortletContext.setAttribute(REQUEST_SCOPE_MANAGER, ((BridgeRequestScopeManagerFactory) BridgeFactoryFinder.getFactoryInstance(BridgeRequestScopeManagerFactory.class)).getBridgeRequestScopeManager(mBridgeConfig));
       // get after put to ensure we get the one that actually stuck
       scopeManager = (BridgeRequestScopeManager) mPortletContext.getAttribute(REQUEST_SCOPE_MANAGER);
     }
@@ -858,8 +861,17 @@ public class BridgeContextImpl extends B
     if (viewId == null)
     {
      // Read the target from the request parameter
-        
-      viewId = request.getParameter(mBridgeConfig.getViewIdRenderParameterName());
+
+     // We encode the viewId in a different parameter in the resource request 
+     // As resource requests can't set render parameters (and hence we might get the old one back in case one not set)
+     if (((Bridge.PortletPhase) mPortletRequest.getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE)) != Bridge.PortletPhase.RESOURCE_PHASE)
+     {
+         viewId = mPortletRequest.getParameter(mBridgeConfig.getViewIdRenderParameterName());
+     }
+     else
+     {
+       viewId = mPortletRequest.getParameter(mBridgeConfig.getViewIdResourceParameterName());
+     }  
 
       // TODO:
       if (viewId != null) mBridgeConfig.getLogger().log("BridgeContextImpl.getViewId: found jsf target viewId = " + viewId);

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/PreFacesFacesContext.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/PreFacesFacesContext.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/PreFacesFacesContext.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/context/PreFacesFacesContext.java Wed Jan  4 22:24:38 2012
@@ -49,7 +49,8 @@ import java.net.MalformedURLException;
 
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfigImpl;
 import org.apache.myfaces.portlet.faces.util.map.PortletApplicationMap;
 import org.apache.myfaces.portlet.faces.util.map.PortletInitParameterMap;
 

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeControllerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeControllerImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeControllerImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/controller/BridgeControllerImpl.java Wed Jan  4 22:24:38 2012
@@ -80,16 +80,14 @@ import javax.portlet.faces.event.EventNa
 import javax.servlet.ServletRequestAttributeEvent;
 import javax.servlet.ServletRequestAttributeListener;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeConfig;
-import org.apache.myfaces.portlet.faces.bridge.BridgeContext;
-import org.apache.myfaces.portlet.faces.bridge.BridgeController;
-import org.apache.myfaces.portlet.faces.bridge.BridgeImpl;
-import org.apache.myfaces.portlet.faces.bridge.BridgeLogger;
-import org.apache.myfaces.portlet.faces.bridge.BridgePostConstructFacesContextSystemEvent;
-import org.apache.myfaces.portlet.faces.bridge.BridgePreReleaseFacesContextSystemEvent;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScope;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScopeManager;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScopeUtil;
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
+import org.apache.myfaces.portlet.faces.bridge.logger.BridgeLogger;
+import org.apache.myfaces.portlet.faces.bridge.event.BridgePostConstructFacesContextSystemEvent;
+import org.apache.myfaces.portlet.faces.bridge.event.BridgePreReleaseFacesContextSystemEvent;
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScope;
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScopeManager;
+import org.apache.myfaces.portlet.faces.bridge.scope.BridgeRequestScopeUtil;
 import org.apache.myfaces.portlet.faces.bridge.wrapper.BridgeEventRequestWrapper;
 import org.apache.myfaces.portlet.faces.bridge.wrapper.BridgeRenderRequestWrapper;
 import org.apache.myfaces.portlet.faces.context.PortletExternalContextImpl;

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLoggerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLoggerImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLoggerImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/logger/BridgeLoggerImpl.java Wed Jan  4 22:24:38 2012
@@ -12,8 +12,10 @@
 
 package org.apache.myfaces.portlet.faces.bridge.logger;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeConfig;
-import org.apache.myfaces.portlet.faces.bridge.BridgeLogger;
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -23,6 +25,9 @@ import org.apache.myfaces.portlet.faces.
 public class BridgeLoggerImpl implements BridgeLogger
 {
   
+  private static final Logger LOG = LoggerFactory.getLogger(BridgeLoggerImpl.class);
+
+  
   private BridgeConfig mBridgeConfig;
   private boolean mIsEnabled = false;
   private int mLogLevel;
@@ -36,7 +41,7 @@ public class BridgeLoggerImpl implements
   {
     if (isEnabled())
     {
-      mBridgeConfig.getPortletConfig().getPortletContext().log(msg);
+      LOG.debug(msg);
     }
   }
   
@@ -44,13 +49,13 @@ public class BridgeLoggerImpl implements
   {
     if (isEnabled())
     {
-      mBridgeConfig.getPortletConfig().getPortletContext().log(msg, throwable);
+      LOG.debug(msg, throwable);
     }
   }
   
   public boolean isEnabled()
   {
-    return mIsEnabled;
+    return (mIsEnabled || LOG.isDebugEnabled() || LOG.isErrorEnabled() || LOG.isWarnEnabled() || LOG.isTraceEnabled() || LOG.isInfoEnabled());
   }
   
   public void setEnabled(Boolean enable)

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeImpl.java Wed Jan  4 22:24:38 2012
@@ -26,30 +26,11 @@ import java.util.Set;
 import java.util.Vector;
 import java.util.concurrent.ConcurrentHashMap;
 
-import java.util.concurrent.ConcurrentMap;
 
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import javax.portlet.PortalContext;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletSession;
 import javax.portlet.faces.annotation.BridgePreDestroy;
-import javax.portlet.faces.annotation.ExcludeFromManagedRequestScope;
 
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpSession;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeContext;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScope;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScopeUtil;
 
 
 /**
@@ -298,19 +279,22 @@ public class  BridgeRequestScopeImpl ext
   
   private Object notifyPreDestroy(Object o)
   {
-    Method[] methods = o.getClass().getMethods();
-    for (int m = 0; m < methods.length; m++)
+    if (o != null)
     {
-      if (methods[m].isAnnotationPresent(BridgePreDestroy.class))
+      Method[] methods = o.getClass().getMethods();
+      for (int m = 0; m < methods.length; m++)
       {
-        try
-        {
-          methods[m].invoke(o, null);
-        }
-        catch (Exception e)
+        if (methods[m].isAnnotationPresent(BridgePreDestroy.class))
         {
-          // do nothing and forge ahead
-          BridgeContext.log("Bridge notifyPreDestroy attempt failed.", e);
+          try
+          {
+            methods[m].invoke(o, null);
+          }
+          catch (Exception e)
+          {
+            // do nothing and forge ahead
+            BridgeContext.log("Bridge notifyPreDestroy attempt failed.", e);
+          }
         }
       }
     }

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManagerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManagerImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManagerImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeManagerImpl.java Wed Jan  4 22:24:38 2012
@@ -26,10 +26,12 @@ import java.util.concurrent.ConcurrentHa
 import javax.portlet.PortletContext;
 import javax.portlet.faces.Bridge;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeConfig;
-import org.apache.myfaces.portlet.faces.bridge.BridgeContext;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScope;
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScopeManager;
+import org.apache.myfaces.portlet.faces.bridge.config.BridgeConfig;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeControllerFactory;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeFactoryFinder;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeLoggerFactory;
+import org.apache.myfaces.portlet.faces.bridge.factory.BridgeRequestScopeFactory;
 
 /**
  * The RequestScopeManager manages a set of RequestScopes based on its desired policies.
@@ -62,7 +64,8 @@ public class BridgeRequestScopeManagerIm
    */
   public BridgeRequestScope createRequestScope(BridgeContext bCtx, String portletName, String sessionId,  String viewId, String portletMode)
   {
-    BridgeRequestScope scope = new BridgeRequestScopeImpl(portletName, sessionId, viewId, portletMode);
+    
+    BridgeRequestScope scope = ((BridgeRequestScopeFactory) BridgeFactoryFinder.getFactoryInstance(BridgeRequestScopeFactory.class)).getBridgeRequestScope(portletName, sessionId, viewId, portletMode);
     mScopeRepository.put((String) scope.getId(), scope);
     mIdMap.put(getQualifiedKey(portletName, sessionId, viewId, portletMode), scope.getId());
     return scope;

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeRepository.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeRepository.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeRepository.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/scope/BridgeRequestScopeRepository.java Wed Jan  4 22:24:38 2012
@@ -16,8 +16,6 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.concurrent.ConcurrentMap;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeRequestScope;
-
 
 /**
  * The RequestScopeManager manages a set of RequestScopes based on its desired policies.

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java Wed Jan  4 22:24:38 2012
@@ -42,7 +42,6 @@ import java.util.Map;
 import java.util.Set;
 
 import javax.faces.FacesException;
-import javax.faces.application.ViewHandler;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.context.Flash;
@@ -71,9 +70,8 @@ import javax.portlet.faces.BridgeDefault
 import javax.portlet.faces.BridgeInvalidViewPathException;
 import javax.servlet.http.Cookie;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeContext;
-import org.apache.myfaces.portlet.faces.bridge.BridgeImpl;
-import org.apache.myfaces.portlet.faces.bridge.BridgePreReleaseFacesContextSystemEvent;
+import org.apache.myfaces.portlet.faces.bridge.event.BridgePreReleaseFacesContextSystemEvent;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 import org.apache.myfaces.portlet.faces.util.FacesVersionUtil;
 import org.apache.myfaces.portlet.faces.util.QueryString;
 import org.apache.myfaces.portlet.faces.util.URLUtils;
@@ -435,7 +433,7 @@ public class PortletExternalContextImpl
 
       if (viewId != null)
       {
-        encodeFacesActionTarget(queryStr, viewId);
+        encodeFacesActionTarget(queryStr, viewId, (urlType != Bridge.PortletPhase.RESOURCE_PHASE) ? mBridgeContext.getBridgeConfig().getViewIdRenderParameterName() : mBridgeContext.getBridgeConfig().getViewIdResourceParameterName());
       }
       else
       {
@@ -999,7 +997,7 @@ public class PortletExternalContextImpl
     {
       // This is a Faces resource
       // put the viewId in the QueryStr.
-      queryStr.addParameter(getBridgeContext().getBridgeConfig().getViewIdRenderParameterName(), viewId);
+      queryStr.addParameter(getBridgeContext().getBridgeConfig().getViewIdResourceParameterName(), viewId);
       queryStr.removeParameter(Bridge.PORTLET_MODE_PARAMETER);
       queryStr.removeParameter(Bridge.PORTLET_WINDOWSTATE_PARAMETER);
     }
@@ -1408,13 +1406,13 @@ public class PortletExternalContextImpl
   @Override
   public void log(String message)
   {
-    mPortletContext.log(message);
+    mBridgeContext.getBridgeConfig().getLogger().log(message);
   }
 
   @Override
   public void log(String message, Throwable t)
   {
-    mPortletContext.log(message, t);
+    mBridgeContext.getBridgeConfig().getLogger().log(message, t);
   }
 
   @Override
@@ -1894,7 +1892,7 @@ public class PortletExternalContextImpl
   // End of JSF 1.2 API
   
   // SystemEventListener IMPL
-  void processEvent(SystemEvent event)
+  public void processEvent(SystemEvent event)
                     throws AbortProcessingException
   {
     if (event instanceof BridgePreReleaseFacesContextSystemEvent)
@@ -1903,7 +1901,7 @@ public class PortletExternalContextImpl
     }
   }
   
-  boolean isListenerForSource(Object source)
+  public boolean isListenerForSource(Object source)
   {
     BridgeContext bCtx = BridgeContext.getCurrentInstance();
     return source == bCtx;
@@ -2589,7 +2587,7 @@ public class PortletExternalContextImpl
     return url;
   }
   
-  private void encodeFacesActionTarget(QueryString queryStr, String target)
+  private void encodeFacesActionTarget(QueryString queryStr, String target, String paramName)
   {
     // determine mode that we need to encode with this viewId
     String mode = queryStr.getParameter(Bridge.PORTLET_MODE_PARAMETER);
@@ -2605,7 +2603,7 @@ public class PortletExternalContextImpl
     }
     
     // put the viewId in the QueryStr.
-    queryStr.setParameter(getBridgeContext().getBridgeConfig().getViewIdRenderParameterName(),
+    queryStr.setParameter(paramName,
                           new StringBuffer(100).append(mode).append(':').append(target).toString());
   }
   

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java?rev=1227359&r1=1227358&r2=1227359&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextFactoryImpl.java Wed Jan  4 22:24:38 2012
@@ -35,8 +35,7 @@ import javax.portlet.PortletResponse;
 import javax.portlet.faces.Bridge;
 import javax.portlet.faces.annotation.PortletNamingContainer;
 
-import org.apache.myfaces.portlet.faces.bridge.BridgeContext;
-import org.apache.myfaces.portlet.faces.bridge.BridgeImpl;
+import org.apache.myfaces.portlet.faces.bridge.context.BridgeContext;
 import org.apache.myfaces.portlet.faces.el.PortletELContextImpl;
 import org.apache.myfaces.shared_portlet.util.ExternalContextUtils;
 



Mime
View raw message