| 1 |
/* |
| 2 |
* Copyright (c) 2021 Red Hat and others |
| 3 |
* |
| 4 |
* This program and the accompanying materials are made available under the |
| 5 |
* Apache Software License 2.0 which is available at: |
| 6 |
* https://www.apache.org/licenses/LICENSE-2.0. |
| 7 |
* |
| 8 |
* SPDX-License-Identifier: Apache-2.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
package jakarta.enterprise.inject.build.compatible.spi; |
| 12 |
|
| 13 |
import jakarta.enterprise.inject.spi.Extension; |
| 14 |
|
| 15 |
import java.lang.annotation.ElementType; |
| 16 |
import java.lang.annotation.Retention; |
| 17 |
import java.lang.annotation.RetentionPolicy; |
| 18 |
import java.lang.annotation.Target; |
| 19 |
|
| 20 |
/** |
| 21 |
* If a {@linkplain BuildCompatibleExtension build compatible extension} is annotated |
| 22 |
* {@code @SkipIfPortableExtensionPresent}, it is ignored when the CDI container |
| 23 |
* can execute portable extensions and determines that a portable extension |
| 24 |
* of {@linkplain #value() given class} is present. |
| 25 |
* <p> |
| 26 |
* It is expected that the specified portable extension class will mirror the functionality |
| 27 |
* of the annotated build compatible extension. This allows portable extensions |
| 28 |
* and build compatible extensions to coexist. |
| 29 |
* |
| 30 |
* @since 4.0 |
| 31 |
*/ |
| 32 |
@Target(ElementType.TYPE) |
| 33 |
@Retention(RetentionPolicy.RUNTIME) |
| 34 |
public @interface SkipIfPortableExtensionPresent { |
| 35 |
/** |
| 36 |
* A class implementing {@link Extension} that is expected to mirror the functionality of the annotated |
| 37 |
* build compatible extension. |
| 38 |
* |
| 39 |
* @return a portable extension class |
| 40 |
*/ |
| 41 |
Class<? extends Extension> value(); |
| 42 |
} |