    001// Copyright 2009, 2012 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
    015package org.apache.tapestry5.ioc;
    016
    017/**
    018 * Extension to {@link org.apache.tapestry5.ioc.ServiceLifecycle} that adds an additional method.
    019 */
    020public interface ServiceLifecycle2 extends ServiceLifecycle
    021{
    022    /**
    023     * If true, then lifecycle requires a proxy, meaning it is only usable with services that properly define a service
    024     * interface. The default (singleton) scope does not require a proxy, but most other service scopes do. The default
    025     * (when wrapping a {@link org.apache.tapestry5.ioc.ServiceLifecycle} as a {@link
    026     * org.apache.tapestry5.ioc.ServiceLifecycle2} is to return true.
    027     *
    028     * @return true if proxying is necessary, false otherwise
    029     */
    030    boolean requiresProxy();
    031}