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