/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.camel.cdi;

import javax.enterprise.util.AnnotationLiteral;
import javax.inject.Qualifier;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * CDI qualifier to be used for multi Camel contexts CDI deployment.
 * {@code CamelContext} beans can be annotated with the {@code @ContextName} qualifier
 * so that the Camel context is named accordingly, e.g.:
 *
 * <pre><code>
 *     {@literal@}ApplicationScoped
 *     {@literal@}ContextName("foo")
 *     public class FooCamelContext extends DefaultCamelContext {
 *     }
 * </code></pre>
 *
 * Camel resources like route builders, endpoints and producer templates can be annotated with
 * the {@code @ContextName} qualifier as well so that they are associated with the
 * corresponding Camel context, e.g.:
 *
 * <pre><code>
 *     {@literal@}ContextName("foo")
 *     public class FooRouteBuilder extends RouteBuilder {
 *         {@literal@}Override
 *         public void configure() {
 *             from("direct:bar").to("mock:bar");
 *         }
 *     }
 *
 *     {@literal@}Inject
 *     {@literal@}ContextName("foo")
 *     {@literal@}Uri("direct:bar")
 *     ProducerTemplate barProducer;
 *
 *     {@literal@}Inject
 *     {@literal@}ContextName("foo")
 *     {@literal@}Uri("mock:bar")
 *     MockEndpoint barMockEndpoint;
 * </code></pre>
 *
 * @see org.apache.camel.CamelContext
 *
 */
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
public @interface ContextName {

    /**
     * Returns the name of the Camel context.
     */
    String value();

    final class Literal extends AnnotationLiteral<ContextName> implements ContextName {

        private static final long serialVersionUID = 1L;

        private final String name;

        public Literal(String name) {
            this.name = name;
        }

        @Override
        public String value() {
            return name;
        }
    }
}

@@ -1329,36 +1329,32 @@
  %3Cpre%3E%3Ccode%3E%0D%0A *
-    
  %7B@literal@%7DAppl
@@ -1366,28 +1366,24 @@
 onScoped%0D%0A *
-    
  %7B@literal@%7D
@@ -1396,36 +1396,32 @@
 tName(%22foo%22)%0D%0A *
-    
  public class Fo
@@ -1463,28 +1463,24 @@
 ontext %7B%0D%0A *
-    
  %7D%0D%0A * %3C/cod
@@ -1730,28 +1730,24 @@
 e%3E%3Ccode%3E%0D%0A *
-    
  %7B@literal@%7D
@@ -1768,20 +1768,16 @@
 oo%22)%0D%0A *
-    
  public 
@@ -1829,20 +1829,16 @@
 %0A *     
-    
 %7B@litera
@@ -1853,28 +1853,24 @@
 ide%0D%0A *     
-   
- 
 public void 
@@ -1882,28 +1882,24 @@
 gure() %7B%0D%0A *
-    
          fro
@@ -1942,21 +1942,13 @@
     
-   
- 
 %7D%0D%0A *
-    
  %7D%0D%0A
@@ -1945,36 +1945,32 @@
  %7D%0D%0A * %7D%0D%0A *%0D%0A *
-    
  %7B@literal@%7DInje
@@ -1967,36 +1967,32 @@
 eral@%7DInject%0D%0A *
-    
  %7B@literal@%7DCont
@@ -2001,36 +2001,32 @@
 tName(%22foo%22)%0D%0A *
-    
  %7B@literal@%7DUri(
@@ -2042,20 +2042,16 @@
 ar%22)%0D%0A *
-    
  Produce
@@ -2076,28 +2076,24 @@
 cer;%0D%0A *%0D%0A *
-    
  %7B@literal@%7D
@@ -2098,28 +2098,24 @@
 @%7DInject%0D%0A *
-    
  %7B@literal@%7D
@@ -2132,28 +2132,24 @@
 e(%22foo%22)%0D%0A *
-    
  %7B@literal@%7D
@@ -2167,20 +2167,16 @@
 ar%22)%0D%0A *
-    
  MockEnd

Fix Javadoc indentation