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