weaver      2004/07/21 06:32:34

  Modified:    portal/src/java/org/apache/jetspeed/request
                        JetspeedRequestContext.java
               jetspeed-api/src/java/org/apache/jetspeed/request
                        RequestContext.java
  Log:
  Remove property checks.  This may have been to heavy handed on my part.  Will look 
for better
  solutions for keeping RequestContext consistent.
  
  Revision  Changes    Path
  1.24      +34 -11    
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java
  
  Index: JetspeedRequestContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- JetspeedRequestContext.java       20 Jul 2004 20:33:58 -0000      1.23
  +++ JetspeedRequestContext.java       21 Jul 2004 13:32:32 -0000      1.24
  @@ -129,19 +129,19 @@
   
       public HttpServletResponse getResponse()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getResponse()", "response");
  +        ArgUtil.assertPropertyNotNull(response, this, "getResponse()", "response");
           return response;
       }
   
       public ServletConfig getConfig()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getConfig()", "config");
  +        ArgUtil.assertPropertyNotNull(config, this, "getConfig()", "config");
           return config;
       }
   
       public ProfileLocator getProfileLocator()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getProfileLocator()", 
"locator");
  +        ArgUtil.assertPropertyNotNull(locator, this, "getProfileLocator()", 
"locator");
           return locator;
       }
   
  @@ -152,7 +152,7 @@
   
       public Page getPage()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getPage()", "page");
  +        ArgUtil.assertPropertyNotNull(page, this, "getPage()", "page");
           return this.page;
       }
   
  @@ -172,9 +172,32 @@
           this.portletDefinition = portletDefinition;
       }
   
  +    /**
  +     * <p>
  +     * isContnetDispatcherSet
  +     * </p>
  +     *
  +     * @see org.apache.jetspeed.request.RequestContext#isContentDispatcherSet()
  +     * @return <code>true</code> if the ContentDispatcher for request has been set,
  +     * otherwise, returns <code>false</code>
  +     */
  +    public boolean isContentDispatcherSet()
  +    {
  +        return dispatcher != null;
  +    }
  +    
  +    /**
  +     * 
  +     * <p>
  +     * getContentDispatcher
  +     * </p>
  +     *
  +     * @see org.apache.jetspeed.request.RequestContext#getContentDispatcher()
  +     * @return
  +     */
       public ContentDispatcher getContentDispatcher()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getContentDispatcher()", 
"dispatcher");
  +        ArgUtil.assertPropertyNotNull(dispatcher, this, "getContentDispatcher()", 
"dispatcher");
           return dispatcher;
       }
   
  @@ -199,7 +222,7 @@
        */
       public CapabilityMap getCapabilityMap()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getCapabilityMap()", 
"capabilityMap");
  +        ArgUtil.assertPropertyNotNull(capabilityMap, this, "getCapabilityMap()", 
"capabilityMap");
           return this.capabilityMap;
       }
   
  @@ -219,7 +242,7 @@
        */
       public String getMimeType()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getMimeType()", "mimeType");
  +        ArgUtil.assertPropertyNotNull(mimeType, this, "getMimeType()", "mimeType");
           return this.mimeType;
       }
   
  @@ -239,7 +262,7 @@
        */
       public String getMediaType()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getMediaType()", "mediaType");
  +        ArgUtil.assertPropertyNotNull(mediaType, this, "getMediaType()", 
"mediaType");
           return this.mediaType;
       }
   
  @@ -275,7 +298,7 @@
        */
       public String getCharacterEncoding()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getMediaType()", 
"mediaType"); 
  +        ArgUtil.assertPropertyNotNull(encoding, this, "getMediaType()", 
"mediaType"); 
           return this.encoding;
       }
   
  @@ -355,7 +378,7 @@
        */
       public Locale getLocale()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getLocale()", "locale"); 
  +        ArgUtil.assertPropertyNotNull(locale, this, "getLocale()", "locale"); 
           return this.locale;
       }
   
  @@ -488,7 +511,7 @@
        */
       public PortalURL getPortalURL()
       {
  -        ArgUtil.assertPropertyNotNull(request, this, "getPortalURL()", "url"); 
  +        ArgUtil.assertPropertyNotNull(url, this, "getPortalURL()", "url"); 
           return url;
       }
   
  
  
  
  1.6       +5 -50     
jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/request/RequestContext.java
  
  Index: RequestContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/request/RequestContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RequestContext.java       20 Jul 2004 20:33:58 -0000      1.5
  +++ RequestContext.java       21 Jul 2004 13:32:32 -0000      1.6
  @@ -50,8 +50,6 @@
        * being processed by the portlet container.
        *
        * @return HttpServletRequest
  -     * @throws IllegalStateException if <code>request</code>
  -     * has not been set or is null.
        */
       public HttpServletRequest getRequest();
   
  @@ -61,8 +59,6 @@
        * be wrapped using <code>getPortletResponseForWindow()</code> before
        * being processed by the portlet container.
        * @return HttpServletResponse
  -     * * @throws IllegalStateException if <code>response</code>
  -     * has not been set or is null.
        */
       public HttpServletResponse getResponse();
   
  @@ -70,8 +66,6 @@
        * Gets the HTTP Servlet Config
        *
        * @return ServletConfig
  -     * @throws IllegalStateException if <code>servletConfig</code>
  -     * has not been set or is null.
        */
       public ServletConfig getConfig();
   
  @@ -79,8 +73,6 @@
        * Gets the profile locator for this request
        *
        * @return Profile
  -     * @throws IllegalStateException if <code>Profile</code>
  -     * has not been set or is null.
        */
       public ProfileLocator getProfileLocator();
   
  @@ -95,8 +87,6 @@
        * Gets the target page for this request
        *
        * @return Page
  -     * @throws IllegalStateException if <code>Page</code>
  -     * has not been set or is null.
        */
       public Page getPage();
   
  @@ -111,8 +101,6 @@
        * Gets the content dispatcher for this request
        *
        * @return ContentDispatcher
  -     * @throws IllegalStateException if <code>ContentDispatcher</code>
  -     * has not been set or is null.
        */
       public ContentDispatcher getContentDispatcher();
   
  @@ -131,14 +119,8 @@
       public void setCapabilityMap(CapabilityMap map);
   
       /**
  -     * 
  -     * <p>
  -     * getCapabilityMap
  -     * </p>
  +     * Get the Capability Map
        *
  -     * @return CapabilityMap
  -     * @throws IllegalStateException if <code>CapabilityMap</code>
  -     * has not been set or is null.
        */
       public CapabilityMap getCapabilityMap();
   
  @@ -150,14 +132,8 @@
       public void setMimeType(String mimeType);
   
       /**
  -     * 
  -     * <p>
  -     * getMimeType
  -     * </p>
  +     * Get the mimeType for the request
        *
  -     * @return MimeType
  -     * @throws IllegalStateException if <code>MimeType</code>
  -     * has not been set or is null.
        */
       public String getMimeType();
   
  @@ -169,14 +145,8 @@
       public void setMediaType(String mediaType);
   
       /**
  -     * 
  -     * <p>
  -     * getMediaType
  -     * </p>
  +     * get the Media Type
        *
  -     * @return MediaType
  -     * @throws IllegalStateException if <code>MediaType</code>
  -     * has not been set or is null.
        */
       public String getMediaType();
   
  @@ -194,7 +164,7 @@
        * @return The Portal URL object for the current request.  This method will 
never
        * return a <code>null</code> value.
        * @throws IllegalStateException if <code>portalUrl</code>
  -     * has not been set or is null.
  +     * if has not been set.
        */
       public PortalURL getPortalURL();
       
  @@ -223,9 +193,6 @@
        * set character encoding
        *
        * @param enc
  -     * @return CharacterEncoding
  -     * @throws IllegalStateException if <code>CharacterEncoding</code>
  -     * has not been set or is null.
        */
       public void setCharacterEncoding(String enc);
   
  @@ -304,8 +271,6 @@
        *
        * @param key The parameter unique key
        * @return The object associated with the uniqu
  -     * @throws IllegalStateException if <code>request</code>
  -     * has not been set or is null.
        */
       String getRequestParameter(String key);
   
  @@ -316,8 +281,6 @@
        * in that case it simply passes through to the servlet request.
        *
        * @return
  -     * @throws IllegalStateException if <code>request</code>
  -     * has not been set or is null.
        */
       Map getParameterMap();
   
  @@ -330,8 +293,6 @@
        *
        * @param key The key of the attribute
        * @return The value of the attribute
  -     * @throws IllegalStateException if <code>request</code>
  -     * has not been set or is null.
        */
       Object getSessionAttribute(String key);
   
  @@ -343,8 +304,6 @@
        *
        * @param key The key of the session attribute
        * @param value The value of the session attribute
  -     * @throws IllegalStateException if <code>request</code>
  -     * has not been set or is null.
        */
       void setSessionAttribute(String key, Object value);
   
  @@ -353,8 +312,6 @@
        *
        * @param key The key of the request attribute
        * @return The value of the request attribute
  -     * @throws IllegalStateException if <code>request</code>
  -     * has not been set or is null.
        */
       Object getAttribute(String key);
   
  @@ -366,8 +323,6 @@
        *
        * @param key The key of the request attribute
        * @param value The value of the request attribute
  -     * @throws IllegalStateException if <code>request</code>
  -     * has not been set or is null.
        */
       void setAttribute(String key, Object value);
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to