    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;
    014
    015/**
    016 * The source for the module instance needed by any service builders, service contributors and service decorators that
    017 * are mapped to instance methods.
    018 *
    019 * Allows the creation of the module instance to be deferred until actually needed; in practical terms, when the
    020 * builder/decorator/contributor is a <em>static</em> method on the module builder class, then a module instance is not
    021 * needed. This allows Tapestry IOC to work around a tricky chicken-and-the-egg problem, whereby the constructor of a
    022 * module instance requires contributions that originate in the same module.
    023 *
    024 * The term "module builder" has been deprecated; the current term is "module class", but this interface is left as-is
    025 * for backwards compatibility.
    026 */
    027public interface ModuleBuilderSource
    028{
    029    /**
    030     * Returns the instantiated version of the Tapestry IoC module class.
    031     */
    032    Object getModuleBuilder();
    033}