Coverage Report - org.apache.tapestry.portlet.PortletStaleSessionExceptionPresenter
 
Classes in this File Line Coverage Branch Coverage Complexity
PortletStaleSessionExceptionPresenter
0%
0/9
N/A
1
 
 1  
 // Copyright 2005 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // Unless required by applicable law or agreed to in writing, software
 10  
 // distributed under the License is distributed on an "AS IS" BASIS,
 11  
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
 // See the License for the specific language governing permissions and
 13  
 // limitations under the License.
 14  
 
 15  
 package org.apache.tapestry.portlet;
 16  
 
 17  
 import javax.portlet.ActionRequest;
 18  
 import javax.portlet.ActionResponse;
 19  
 
 20  
 import org.apache.tapestry.IRequestCycle;
 21  
 import org.apache.tapestry.StaleSessionException;
 22  
 import org.apache.tapestry.error.StaleSessionExceptionPresenter;
 23  
 import org.apache.tapestry.services.ServiceConstants;
 24  
 
 25  
 /**
 26  
  * @author Howard M. Lewis Ship
 27  
  * @since 4.0
 28  
  */
 29  0
 public class PortletStaleSessionExceptionPresenter implements StaleSessionExceptionPresenter
 30  
 {
 31  
     private PortletRequestGlobals _globals;
 32  
 
 33  
     public void presentStaleSessionException(IRequestCycle cycle, StaleSessionException cause)
 34  
     {
 35  0
         String markup = PortletMessages.staleSession();
 36  
 
 37  0
         ActionRequest request = _globals.getActionRequest();
 38  
 
 39  0
         request.getPortletSession(true).setAttribute(
 40  
                 PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE,
 41  
                 markup);
 42  
 
 43  0
         ActionResponse response = _globals.getActionResponse();
 44  
 
 45  0
         response.setRenderParameter(ServiceConstants.SERVICE, PortletConstants.EXCEPTION_SERVICE);
 46  0
     }
 47  
 
 48  
     public void setGlobals(PortletRequestGlobals globals)
 49  
     {
 50  0
         _globals = globals;
 51  0
     }
 52  
 }