-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add config injection annotations (#75)
* feat: add config injection annotations * lic headers * pr remarks * Update Configuration.java Co-authored-by: Jim Marino <[email protected]> --------- Co-authored-by: Jim Marino <[email protected]>
- Loading branch information
1 parent
ceb0ad7
commit 041ba5a
Showing
3 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...e-metamodel/src/main/java/org/eclipse/edc/runtime/metamodel/annotation/Configuration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.runtime.metamodel.annotation; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Indicates that a certain field is a "configuration object", i.e. a POJO that contains fields annotated with | ||
* {@link Setting}. These fields must be declared inside an extension class. Their respective class declaration must be annotated | ||
* with {@link Settings}. | ||
* Types annotated with this annotation will get instantiated by the EDC dependency injection mechanism using values from the config. | ||
*/ | ||
@Target({ ElementType.FIELD }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface Configuration { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
runtime-metamodel/src/main/java/org/eclipse/edc/runtime/metamodel/annotation/Settings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.runtime.metamodel.annotation; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Denotes that a certain class is a "configuration object", i.e. contains fields annotated with {@link Setting}. Note that | ||
* if the configuration object is a record, it may ONLY contain fields annotated with {@link Setting}. | ||
*/ | ||
@Target({ ElementType.TYPE }) | ||
@Retention(RetentionPolicy.CLASS) | ||
@Documented | ||
public @interface Settings { | ||
} |