1 /* Copyright (c) 2008 Sascha Kohlmann
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU Affero General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Affero General Public License for more details.
12 *
13 * You should have received a copy of the GNU Affero General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 package net.sf.eos.config;
17
18 import static java.lang.annotation.ElementType.TYPE;
19 import static java.lang.annotation.RetentionPolicy.RUNTIME;
20
21 import java.lang.annotation.Retention;
22 import java.lang.annotation.Target;
23
24 import net.sf.eos.Experimental;
25
26 /**
27 * Indicates the internal use of a service in an instance. Use {@link Services}
28 * if the implementation supports more than one {@code Service}.
29 * Internal services may create thru a method, annotated with
30 * {@link FactoryMethod}.
31 * <p>{@code Service} annotations should be volatile between releases.</p>
32 * @author Sascha Kohlmann
33 * @see Services
34 */
35 @Experimental
36 @Retention(value=RUNTIME)
37 @Target(value=TYPE)
38 public @interface Service {
39
40 /**
41 * {@link java.lang.Class} instance of the an internally used service.
42 * @return instance of the an internally used service
43 */
44 Class<?> factory();
45
46 /** The used implementation. */
47 Class<?> implementation() default FactoryMethod.None.class;
48
49 /**
50 * An optional description.
51 * @return a description
52 */
53 String description() default "";
54 }