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