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