1 package org.apache.turbine.annotation; 2 3 import java.lang.annotation.ElementType; 4 import java.lang.annotation.Retention; 5 import java.lang.annotation.RetentionPolicy; 6 import java.lang.annotation.Target; 7 8 /* 9 * Licensed to the Apache Software Foundation (ASF) under one 10 * or more contributor license agreements. See the NOTICE file 11 * distributed with this work for additional information 12 * regarding copyright ownership. The ASF licenses this file 13 * to you under the Apache License, Version 2.0 (the 14 * "License"); you may not use this file except in compliance 15 * with the License. You may obtain a copy of the License at 16 * 17 * http://www.apache.org/licenses/LICENSE-2.0 18 * 19 * Unless required by applicable law or agreed to in writing, 20 * software distributed under the License is distributed on an 21 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 22 * KIND, either express or implied. See the License for the 23 * specific language governing permissions and limitations 24 * under the License. 25 */ 26 27 /** 28 * Annotation to mark fields in modules that require a service to be injected 29 */ 30 @Retention( RetentionPolicy.RUNTIME ) 31 @Target( ElementType.FIELD ) 32 public @interface TurbineService 33 { 34 /** 35 * Get the name of the service to inject 36 * 37 * @return the service name or role 38 */ 39 String value() default ""; 40 41 /** 42 * A constant defining the field name for the service name 43 */ 44 String SERVICE_NAME = "SERVICE_NAME"; 45 46 /** 47 * A constant defining the field name for the role 48 */ 49 String ROLE = "ROLE"; 50 }