This repository has been archived by the owner on May 31, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added audit assertion failures diagnostic facility: AuditPointRuntime…
…Info and co.
- Loading branch information
Showing
5 changed files
with
433 additions
and
87 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
inspektr-audit/src/main/java/com/github/inspektr/audit/AspectJAuditPointRuntimeInfo.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,23 @@ | ||
package com.github.inspektr.audit; | ||
|
||
import org.aspectj.lang.JoinPoint; | ||
|
||
/** | ||
* Wrapper around AspectJ's JoinPoint containing the runtime execution info for current audit points | ||
* | ||
* @author Dmitriy Kopylenko | ||
* | ||
* @since 1.0.6 | ||
*/ | ||
public class AspectJAuditPointRuntimeInfo implements AuditPointRuntimeInfo { | ||
|
||
private JoinPoint currentJoinPoint; | ||
|
||
public AspectJAuditPointRuntimeInfo(JoinPoint currentJoinPoint) { | ||
this.currentJoinPoint = currentJoinPoint; | ||
} | ||
|
||
public String asString() { | ||
return this.currentJoinPoint.toLongString(); | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
inspektr-audit/src/main/java/com/github/inspektr/audit/AuditPointRuntimeInfo.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,19 @@ | ||
package com.github.inspektr.audit; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Encapsulates a runtime execution context at advised audit points. Used for diagnostic purposes | ||
* to provide clear contextual information about any given audit point in case of runtime failures | ||
* during audit capturing operation, e.g. any assert failures, etc. | ||
* | ||
* @author Dmitriy Kopylenko | ||
* @since 1.0.6 | ||
*/ | ||
public interface AuditPointRuntimeInfo extends Serializable { | ||
|
||
/** | ||
* @return String representation of this audit point runtime execution context | ||
*/ | ||
String asString(); | ||
} |
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.