001// Licensed to the Apache Software Foundation (ASF) under one
002// or more contributor license agreements.  See the NOTICE file
003// distributed with this work for additional information
004// regarding copyright ownership.  The ASF licenses this file
005// to you under the Apache License, Version 2.0 (the
006// "License"); you may not use this file except in compliance
007// with the License.  You may obtain a copy of the License at
008//
009// http://www.apache.org/licenses/LICENSE-2.0
010//
011// Unless required by applicable law or agreed to in writing,
012// software distributed under the License is distributed on an
013// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
014// KIND, either express or implied.  See the License for the
015// specific language governing permissions and limitations
016// under the License.
017
018package org.apache.tapestry5.services;
019
020import org.apache.tapestry5.ioc.annotations.UsesMappedConfiguration;
021
022/**
023 * Used to provide access to
024 * {@link org.apache.tapestry5.services.ApplicationStatePersistenceStrategySource} instances
025 * via a logical name for the strategy, such as "session".
026 * <p>
027 * <em>NOTE: The term "Application" here is a hold-over from Tapestry 5.0, which used
028 * the @ApplicationState (deprecated and deleted) annotation, and called them "ASOs"
029 * (Application State Objects). This service would be better named
030 * "SessionStatePersistenceStrategySource" (but renaming it would cause backwards
031 * compatibility issues).</em>
032 */
033@UsesMappedConfiguration(ApplicationStatePersistenceStrategy.class)
034public interface ApplicationStatePersistenceStrategySource
035{
036    /**
037     * Returns the named strategy.
038     *
039     * @param name of strategy to access
040     * @return the strategy
041     * @throws RuntimeException if the name does not match a configured strategy
042     */
043    ApplicationStatePersistenceStrategy get(String name);
044}