    001// Copyright 2006, 2007, 2008 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
    017import org.apache.tapestry5.ioc.annotations.EagerLoad;
    018
    019/**
    020 * Public access to the IoC service registry.
    021 */
    022public interface Registry extends ObjectLocator
    023{
    024    /**
    025     * Invoked at the end of a request to discard any thread-specific information accumulated during the current
    026     * request.
    027     *
    028     * @see org.apache.tapestry5.ioc.services.PerthreadManager
    029     * @see org.apache.tapestry5.ioc.services.ThreadCleanupListener
    030     */
    031    void cleanupThread();
    032
    033    /**
    034     * Shuts down a Registry instance. Notifies all listeners that the registry has shutdown. Further method invocations
    035     * on the Registry are no longer allowed, and the Registry instance should be discarded.
    036     *
    037     * @see org.apache.tapestry5.ioc.services.RegistryShutdownHub
    038     * @see org.apache.tapestry5.ioc.services.RegistryShutdownListener
    039     */
    040    void shutdown();
    041
    042    /**
    043     * Invoked to eagerly load services marked with the {@link EagerLoad} annotation, and to execute all contributions
    044     * to the Startup service.
    045     */
    046    void performRegistryStartup();
    047}