myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulnicolu...@apache.org
Subject svn commit: r1828254 - in /myfaces/core/branches/2.3.x: api/src/main/java/javax/faces/application/ api/src/test/java/javax/faces/application/ impl/src/main/java/org/apache/myfaces/application/ impl/src/main/java/org/apache/myfaces/context/servlet/
Date Tue, 03 Apr 2018 16:33:38 GMT
Author: paulnicolucci
Date: Tue Apr  3 16:33:38 2018
New Revision: 1828254

URL: http://svn.apache.org/viewvc?rev=1828254&view=rev
Log:
MYFACES-4216: getWebsocketURL should be abstract and WEBSOCKET_PORT move and rename

Modified:
    myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ViewHandler.java
    myfaces/core/branches/2.3.x/api/src/test/java/javax/faces/application/ViewHandlerTest.java
    myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
    myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java

Modified: myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ViewHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ViewHandler.java?rev=1828254&r1=1828253&r2=1828254&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ViewHandler.java
(original)
+++ myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ViewHandler.java
Tue Apr  3 16:33:38 2018
@@ -408,12 +408,6 @@ public abstract class ViewHandler
         Set<String> set = Collections.emptySet();
         return Collections.unmodifiableSet(set);
     }
-
-    /**
-     * Indicates the port used for websocket connections.
-     */
-    @JSFWebConfigParam(since = "2.3")
-    public static final java.lang.String WEBSOCKET_PORT = "javax.faces.WEBSOCKET_PORT";
     
     /**
      * Return a JSF URL that represents a websocket connection for the passed channel and
channelToken
@@ -423,13 +417,8 @@ public abstract class ViewHandler
      * @param channelAndToken
      * @return 
      */
-    public String getWebsocketURL(FacesContext context, String channelAndToken)
-    {
-        String url = context.getExternalContext().getRequestContextPath() + 
-                "/javax.faces.push/"+channelAndToken;
-        return url;
-    }
-    
+    public abstract String getWebsocketURL(FacesContext context, String channelAndToken);
+
     /**
      * @since 2.3
      * @param facesContext

Modified: myfaces/core/branches/2.3.x/api/src/test/java/javax/faces/application/ViewHandlerTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/test/java/javax/faces/application/ViewHandlerTest.java?rev=1828254&r1=1828253&r2=1828254&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/test/java/javax/faces/application/ViewHandlerTest.java
(original)
+++ myfaces/core/branches/2.3.x/api/src/test/java/javax/faces/application/ViewHandlerTest.java
Tue Apr  3 16:33:38 2018
@@ -223,5 +223,11 @@ public class ViewHandlerTest extends Tes
             throw new UnsupportedOperationException();
         }
 
+        @Override
+        public String getWebsocketURL(FacesContext context, String channelAndToken)
+        {
+            throw new UnsupportedOperationException();
+        }
+
     }
 }

Modified: myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java?rev=1828254&r1=1828253&r2=1828254&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
(original)
+++ myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
Tue Apr  3 16:33:38 2018
@@ -580,5 +580,12 @@ public class ViewHandlerImpl extends Vie
         return concatenatedStream == null ? Stream.empty() : concatenatedStream;
     }
     
+    @Override
+    public String getWebsocketURL(FacesContext context, String channelAndToken)
+    {
+        String url = context.getExternalContext().getRequestContextPath() + 
+                "/javax.faces.push/"+channelAndToken;
+        return url;
+    }
     
 }

Modified: myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java?rev=1828254&r1=1828253&r2=1828254&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
(original)
+++ myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
Tue Apr  3 16:33:38 2018
@@ -39,7 +39,6 @@ import java.util.logging.Logger;
 
 import javax.faces.FacesException;
 import javax.faces.FactoryFinder;
-import javax.faces.application.ViewHandler;
 import javax.faces.context.FacesContext;
 import javax.faces.context.Flash;
 import javax.faces.context.FlashFactory;
@@ -56,6 +55,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
 import org.apache.myfaces.shared.context.flash.FlashImpl;
 import org.apache.myfaces.shared.util.WebConfigParamUtils;
 import org.apache.myfaces.util.EnumerationIterator;
@@ -79,6 +79,12 @@ public final class ServletExternalContex
     private static final String PUSHED_RESOURCE_URLS = "oam.PUSHED_RESOURCE_URLS";
     private static final String PUSH_SUPPORTED = "oam.PUSH_SUPPORTED";
 
+    /**
+     * Indicates the port used for websocket connections.
+     */
+    @JSFWebConfigParam(since = "2.3")
+    public static final java.lang.String WEBSOCKET_ENDPOINT_PORT = "javax.faces.WEBSOCKET_ENDPOINT_PORT";
+
     private ServletRequest _servletRequest;
     private ServletResponse _servletResponse;
     private Map<String, Object> _sessionMap;
@@ -456,7 +462,7 @@ public final class ServletExternalContex
         checkNull(url, "url");
         FacesContext facesContext = getCurrentFacesContext();
         Integer port = WebConfigParamUtils.getIntegerInitParameter(
-                getCurrentFacesContext().getExternalContext(), ViewHandler.WEBSOCKET_PORT);
+                getCurrentFacesContext().getExternalContext(), WEBSOCKET_ENDPOINT_PORT);
         port = (port == 0) ? null : port;
         if (port != null && 
             !port.equals(facesContext.getExternalContext().getRequestServerPort()))



Mime
View raw message