001// Copyright 2009 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.annotations; 016 017import java.lang.annotation.*; 018 019/** 020 * Marks a service as not eligible for decoration. This is useful for services that, if decorated, can cause cycle 021 * dependency errors; for example, {@link org.apache.tapestry5.ioc.services.MasterObjectProvider}, or services 022 * <em>contributed to</em> MasterObjectProvider, are good candidates for this annotation. 023 * <p/> 024 * The annotation can be applied to service implementation class or to a service builder method in a module class. 025 * <p/> 026 * The annotation may also be placed on a module class, to indicate that all services defined for the module should not 027 * allow decoration. 028 * <p/> 029 * Service decoration includes the decoration mechanism (from Tapestry 5.0) and the newer service advice mechanism (from 030 * Tapestry 5.1). 031 * 032 * @see org.apache.tapestry5.ioc.def.ServiceDef2#isPreventDecoration() 033 * @since 5.1.0.0 034 */ 035@Target({ ElementType.TYPE, ElementType.METHOD }) 036@Retention(RetentionPolicy.RUNTIME) 037@Documented 038@UseWith(AnnotationUseContext.SERVICE) 039public @interface PreventServiceDecoration 040{ 041}