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.IncompatibleChange;
019import org.slf4j.Logger;
020
021/**
022 * Contains resources that may be provided to a service when it initializes, which includes other services defined in
023 * the registry. ServiceResources provides access to other services (it extends
024 * {@link org.apache.tapestry5.commons.ObjectLocator}).
025 */
026public interface ServiceResources extends ObjectLocator, AnnotationAccess
027{
028    /**
029     * Returns the fully qualified id of the service.
030     */
031    String getServiceId();
032
033    /**
034     * Returns the service interface implemented by the service.
035     */
036    Class getServiceInterface();
037
038    /**
039     * Returns the service implementation.
040     */
041    @IncompatibleChange(release = "5.4", details = "Added method for TAP5-2029")
042    Class getServiceImplementation();
043
044    /**
045     * Returns a Logger appropriate for logging messages. This includes debug level messages about the creation and
046     * configuration of the underlying service, as well as debug, warning, or error level messages from the service
047     * itself. Often service interceptors will make use of the service's logger.
048     */
049    Logger getLogger();
050
051    /**
052     * Returns an object that can be used to track operations related to constructing, configuring, decorating and
053     * initializing the service.
054     */
055    OperationTracker getTracker();
056
057}