    001    // Copyright 2010 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    package org.apache.tapestry5.ioc;
    015
    016    import java.util.Set;
    017
    018    import org.apache.tapestry5.ioc.def.ServiceDef;
    019
    020
    021    /**
    022     * Interface implemented by objects which need to disambiguate services with marker annotations.
    023     *
    024     * @since 5.2.2
    025     */
    026    public interface Markable
    027    {
    028        /**
    029         * Returns an optional set of <em>marker annotation</em>. Marker annotations are used to disambiguate services; the
    030         * combination of a marker annotation and a service type is expected to be unique. Note that it is not possible
    031         * to identify which annotations are markers and which are not when this set is constructed, so it may include
    032         * non-marker annotations.
    033         *
    034         * @see ServiceDef#getMarkers()
    035         */
    036        Set<Class> getMarkers();
    037
    038        /**
    039         * Returns the service interface associated with the service.
    040         *
    041         * @see ServiceDef#getServiceInterface()
    042         */
    043        Class getServiceInterface();
    044    }