001// Licensed under the Apache License, Version 2.0 (the "License");
002// you may not use this file except in compliance with the License.
003// You may obtain a copy of the License at
004//
005// http://www.apache.org/licenses/LICENSE-2.0
006//
007// Unless required by applicable law or agreed to in writing, software
008// distributed under the License is distributed on an "AS IS" BASIS,
009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
010// See the License for the specific language governing permissions and
011// limitations under the License.
012
013package org.apache.tapestry5.ioc.services;
014
015import org.apache.tapestry5.ioc.ServiceLifecycle;
016import org.apache.tapestry5.ioc.annotations.UsesMappedConfiguration;
017
018/**
019 * Provides access to user defined lifecycles (beyond the two built-in lifecycles: "singleton" and "primitive"). The
020 * user defined lifecycles are contributed into the service's configuration.
021 *
022 * Note that the default scope {@linkplain org.apache.tapestry5.ioc.ScopeConstants#DEFAULT "singleton"} is special and
023 * not a contribution.
024 */
025@UsesMappedConfiguration(ServiceLifecycle.class)
026public interface ServiceLifecycleSource
027{
028    /**
029     * Used to locate a configuration lifecycle, by name.
030     * 
031     * @param scope
032     * @return the named lifecycle, or null if the name is not found
033     */
034    ServiceLifecycle get(String scope);
035}