You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2008/03/03 18:10:39 UTC

svn commit: r633178 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry/internal/services/ main/java/org/apache/tapestry/services/ main/java/org/apache/tapestry/test/ site/apt/ test/java/org/apache/tapestry/internal/services/

Author: hlship
Date: Mon Mar  3 09:10:36 2008
New Revision: 633178

URL: http://svn.apache.org/viewvc?rev=633178&view=rev
Log:
TAPESTRY-1336: Refactor ApplicationGlobals's store methods

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ApplicationGlobalsImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/RequestGlobalsImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationGlobals.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/RequestGlobals.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java
    tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ResourceStreamerImplTest.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ApplicationGlobalsImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ApplicationGlobalsImpl.java?rev=633178&r1=633177&r2=633178&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ApplicationGlobalsImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ApplicationGlobalsImpl.java Mon Mar  3 09:10:36 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
 
     private Context _context;
 
-    public void store(ServletContext context)
+    public void storeServletContext(ServletContext context)
     {
         _servletContext = context;
     }
@@ -40,7 +40,7 @@
         return _context;
     }
 
-    public void store(Context context)
+    public void storeContext(Context context)
     {
         _context = context;
     }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/RequestGlobalsImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/RequestGlobalsImpl.java?rev=633178&r1=633177&r2=633178&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/RequestGlobalsImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/RequestGlobalsImpl.java Mon Mar  3 09:10:36 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@
 
     private Response _response;
 
-    public void store(HttpServletRequest request, HttpServletResponse response)
+    public void storeServletRequestResponse(HttpServletRequest request, HttpServletResponse response)
     {
         _servletRequest = request;
         _servletResponse = response;
@@ -53,7 +53,7 @@
         return _servletResponse;
     }
 
-    public void store(Request request, Response response)
+    public void storeRequestResponse(Request request, Response response)
     {
         _request = request;
         _response = response;

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationGlobals.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationGlobals.java?rev=633178&r1=633177&r2=633178&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationGlobals.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ApplicationGlobals.java Mon Mar  3 09:10:36 2008
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2008 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -21,11 +21,11 @@
  */
 public interface ApplicationGlobals
 {
-    void store(ServletContext context);
+    void storeServletContext(ServletContext context);
 
     ServletContext getServletContext();
 
-    void store(Context context);
+    void storeContext(Context context);
 
     Context getContext();
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/RequestGlobals.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/RequestGlobals.java?rev=633178&r1=633177&r2=633178&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/RequestGlobals.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/RequestGlobals.java Mon Mar  3 09:10:36 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -26,13 +26,16 @@
     /**
      * Stores the servlet API request and response objects, for access via the properties.
      */
-    void store(HttpServletRequest request, HttpServletResponse response);
+    void storeServletRequestResponse(HttpServletRequest request, HttpServletResponse response);
 
+    /**
+     * The Servlet API Request. This is exposed as service HTTPServletRequest.
+     */
     HttpServletRequest getHTTPServletRequest();
 
     HttpServletResponse getHTTPServletResponse();
 
-    void store(Request request, Response response);
+    void storeRequestResponse(Request request, Response response);
 
     /**
      * The current request. This is exposed as service Request.

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java?rev=633178&r1=633177&r2=633178&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java Mon Mar  3 09:10:36 2008
@@ -545,7 +545,7 @@
         {
             public boolean service(Request request, Response response, RequestHandler handler) throws IOException
             {
-                _requestGlobals.store(request, response);
+                _requestGlobals.storeRequestResponse(request, response);
 
                 return handler.service(request, response);
             }
@@ -891,7 +891,7 @@
         {
             public void initializeApplication(Context context)
             {
-                _applicationGlobals.store(context);
+                _applicationGlobals.storeContext(context);
             }
         };
 
@@ -909,7 +909,7 @@
             public boolean service(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
                     throws IOException
             {
-                _requestGlobals.store(servletRequest, servletResponse);
+                _requestGlobals.storeServletRequestResponse(servletRequest, servletResponse);
 
                 Request request = new RequestImpl(servletRequest);
                 Response response = new ResponseImpl(servletResponse);
@@ -934,7 +934,7 @@
         {
             public boolean service(Request request, Response response) throws IOException
             {
-                _requestGlobals.store(request, response);
+                _requestGlobals.storeRequestResponse(request, response);
 
                 return masterDispatcher.dispatch(request, response);
             }
@@ -952,7 +952,7 @@
         {
             public void initializeApplication(ServletContext context)
             {
-                _applicationGlobals.store(context);
+                _applicationGlobals.storeServletContext(context);
 
                 // And now, down the (Web) ApplicationInitializer pipeline ...
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java?rev=633178&r1=633177&r2=633178&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/PageTester.java Mon Mar  3 09:10:36 2008
@@ -101,7 +101,7 @@
 
         ApplicationGlobals globals = _registry.getObject(ApplicationGlobals.class, null);
 
-        globals.store(new PageTesterContext(contextPath));
+        globals.storeContext(new PageTesterContext(contextPath));
 
         Map<Class, ComponentInvoker> map = newMap();
         map.put(PageLinkTarget.class, new PageLinkInvoker(_registry));

Modified: tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt?rev=633178&r1=633177&r2=633178&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt Mon Mar  3 09:10:36 2008
@@ -68,4 +68,9 @@
 
   The return type for <<<getStackTrace()>>> on
   {{{../apidocs/org/apache/tapestry/services/ExceptionInfo.html}ExceptionInfo}}
-  changed from List\<String\> to List\<StackTraceElement\>.
\ No newline at end of file
+  changed from List\<String\> to List\<StackTraceElement\>.
+
+* ApplicationGlobals and RequestGlobals
+
+  The <store> methods on these two interfaces were renamed to be more explicit. These are not methods typically
+  invoked from user code.
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ResourceStreamerImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ResourceStreamerImplTest.java?rev=633178&r1=633177&r2=633178&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ResourceStreamerImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ResourceStreamerImplTest.java Mon Mar  3 09:10:36 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@
         ResourceStreamer streamer = getService(ResourceStreamer.class);
         RequestGlobals globals = getService(RequestGlobals.class);
 
-        globals.store(request, response);
+        globals.storeRequestResponse(request, response);
 
         String path = getClass().getPackage().getName().replace('.', '/') + "/" + fileName;