001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. 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 distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.rest.springboot.annotation; 014 015import static java.lang.annotation.ElementType.*; 016import static java.lang.annotation.RetentionPolicy.*; 017 018import org.apache.juneau.rest.RestServlet; 019import org.springframework.context.annotation.*; 020 021import java.lang.annotation.*; 022 023/** 024 * Added to Spring application classes to denote Juneau REST resource classes to deploy as servlets. 025 * 026 * <p> 027 * The annotation can be used in two places: 028 * <ul class='spaced-list'> 029 * <li> 030 * On the source class of a Spring Boot application. 031 * <li> 032 * On {@link Bean}-annotated methods on configuration beans. 033 * </ul> 034 */ 035@Target({TYPE,METHOD}) 036@Retention(RUNTIME) 037@Documented 038@Inherited 039public @interface JuneauRestRoot { 040 041 /** 042 * Specifies one or more implementations of {@link RestServlet} to deploy as servlets. 043 * <p> 044 * This method is only applicable when used on the source class of a Spring Boot application. 045 */ 046 Class<? extends RestServlet>[] servlets() default {}; 047}