001 // Copyright 2005 The Apache Software Foundation 002 // 003 // Licensed under the Apache License, Version 2.0 (the "License"); 004 // you may not use this file except in compliance with the License. 005 // You may obtain a copy of the License at 006 // 007 // http://www.apache.org/licenses/LICENSE-2.0 008 // 009 // Unless required by applicable law or agreed to in writing, software 010 // distributed under the License is distributed on an "AS IS" BASIS, 011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 012 // See the License for the specific language governing permissions and 013 // limitations under the License. 014 015 package org.apache.tapestry.engine; 016 017 import org.apache.hivemind.ErrorHandler; 018 import org.apache.tapestry.record.PropertyPersistenceStrategySource; 019 import org.apache.tapestry.request.RequestContext; 020 import org.apache.tapestry.services.AbsoluteURLBuilder; 021 import org.apache.tapestry.services.Infrastructure; 022 023 /** 024 * An object that contains all the invariant parameters to the 025 * {@link org.apache.tapestry.engine.RequestCycle#RequestCycle(IEngine, QueryParameterMap, IEngineService, IMonitor, RequestCycleEnvironment)} 026 * constructor. 027 * 028 * @author Howard M. Lewis Ship 029 * @since 4.0 030 */ 031 public class RequestCycleEnvironment 032 { 033 private Infrastructure _infrastructure; 034 035 private PropertyPersistenceStrategySource _strategySource; 036 037 private AbsoluteURLBuilder _absoluteURLBuilder; 038 039 private ErrorHandler _errorHandler; 040 041 private RequestContext _requestContext; 042 043 public RequestCycleEnvironment(ErrorHandler errorHandler, Infrastructure infrastructure, 044 RequestContext requestContext, PropertyPersistenceStrategySource strategySource, 045 AbsoluteURLBuilder absoluteURLBuilder) 046 { 047 _errorHandler = errorHandler; 048 _infrastructure = infrastructure; 049 _requestContext = requestContext; 050 _strategySource = strategySource; 051 _absoluteURLBuilder = absoluteURLBuilder; 052 } 053 054 public AbsoluteURLBuilder getAbsoluteURLBuilder() 055 { 056 return _absoluteURLBuilder; 057 } 058 059 public ErrorHandler getErrorHandler() 060 { 061 return _errorHandler; 062 } 063 064 public Infrastructure getInfrastructure() 065 { 066 return _infrastructure; 067 } 068 069 public PropertyPersistenceStrategySource getStrategySource() 070 { 071 return _strategySource; 072 } 073 074 public RequestContext getRequestContext() 075 { 076 return _requestContext; 077 } 078 }