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.IEngine;
019 import org.apache.tapestry.record.PropertyPersistenceStrategySource;
020 import org.apache.tapestry.services.AbsoluteURLBuilder;
021 import org.apache.tapestry.services.Infrastructure;
022 import org.apache.tapestry.util.QueryParameterMap;
023
024 /**
025 * An object that contains all the invariant parameters to the
026 * {@link org.apache.tapestry.engine.RequestCycle#RequestCycle(IEngine, QueryParameterMap, IEngineService, IMonitor, RequestCycleEnvironment)}
027 * constructor.
028 *
029 * @author Howard M. Lewis Ship
030 * @since 4.0
031 */
032 public class RequestCycleEnvironment
033 {
034 private final Infrastructure _infrastructure;
035
036 private final PropertyPersistenceStrategySource _strategySource;
037
038 private final AbsoluteURLBuilder _absoluteURLBuilder;
039
040 private final ErrorHandler _errorHandler;
041
042 public RequestCycleEnvironment(ErrorHandler errorHandler, Infrastructure infrastructure,
043 PropertyPersistenceStrategySource strategySource, AbsoluteURLBuilder absoluteURLBuilder)
044 {
045 _errorHandler = errorHandler;
046 _infrastructure = infrastructure;
047 _strategySource = strategySource;
048 _absoluteURLBuilder = absoluteURLBuilder;
049 }
050
051 public AbsoluteURLBuilder getAbsoluteURLBuilder()
052 {
053 return _absoluteURLBuilder;
054 }
055
056 public ErrorHandler getErrorHandler()
057 {
058 return _errorHandler;
059 }
060
061 public Infrastructure getInfrastructure()
062 {
063 return _infrastructure;
064 }
065
066 public PropertyPersistenceStrategySource getStrategySource()
067 {
068 return _strategySource;
069 }
070 }