This repository has been archived by the owner on Mar 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Context/Scope feature to di #54
Context/Scope is definded and used by the ServiceProvider ServiceConsumer have no control over the Scope of referneces
- Loading branch information
Showing
36 changed files
with
891 additions
and
414 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
di-api/src/main/java/de/unistuttgart/iaas/amyassist/amy/core/di/annotation/Context.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,24 @@ | ||
package de.unistuttgart.iaas.amyassist.amy.core.di.annotation; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Declare the use of context information | ||
* | ||
* @author Leon Kiefer | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@Target(java.lang.annotation.ElementType.FIELD) | ||
public @interface Context { | ||
/** | ||
* The class of the context provider to use for getting the context | ||
* information | ||
* | ||
* @return the ContextProvider class | ||
*/ | ||
Class<?> value(); | ||
} |
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
35 changes: 0 additions & 35 deletions
35
di-api/src/main/java/de/unistuttgart/iaas/amyassist/amy/core/di/annotation/Scope.java
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...main/java/de/unistuttgart/iaas/amyassist/amy/core/di/context/provider/StaticProvider.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,17 @@ | ||
package de.unistuttgart.iaas.amyassist.amy.core.di.context.provider; | ||
|
||
/** | ||
* A Static Context Provider which provides context information from then | ||
* consumer class. | ||
* | ||
* @author Leon Kiefer | ||
*/ | ||
public interface StaticProvider<T> { | ||
/** | ||
* | ||
* @param consumer | ||
* the class of the consumer | ||
* @return the context information | ||
*/ | ||
T getContext(Class<?> consumer); | ||
} |
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
Oops, something went wrong.