-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new feature: @CacheKaeyable to generate a CacheKey for annotated methods
- Loading branch information
Showing
8 changed files
with
147 additions
and
3 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...deller-annotations/src/main/java/com/coremedia/beanmodeller/annotations/CacheKeyable.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 com.coremedia.beanmodeller.annotations; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Generate a CoreMedia CacheKey for the annotated method and delegate the CacheKeys evaluate() method to the original | ||
* method. | ||
* Makes an easy way to cache methods in the CoreMedia cache. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(value = {ElementType.METHOD}) | ||
public @interface CacheKeyable { | ||
|
||
} |
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
20 changes: 20 additions & 0 deletions
20
...c/main/java/com/coremedia/beanmodeller/beaninformation/CacheKeyableMethodInformation.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,20 @@ | ||
package com.coremedia.beanmodeller.beaninformation; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
/** | ||
* Store information about methods that should have a CacheKey generated around them. | ||
*/ | ||
public class CacheKeyableMethodInformation { | ||
|
||
private final Method method; | ||
|
||
public CacheKeyableMethodInformation(Method method) { | ||
|
||
this.method = method; | ||
} | ||
|
||
public Method getMethod() { | ||
return method; | ||
} | ||
} |
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
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
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
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
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