Skip to content

Feature/aop#30

Merged
jhonatapers merged 29 commits intodevelopfrom
feature/aop
May 18, 2025
Merged

Feature/aop#30
jhonatapers merged 29 commits intodevelopfrom
feature/aop

Conversation

@jhonatapers
Copy link
Copy Markdown
Member

This pull request introduces several significant updates, including configuration setup, dependency updates, and the addition of an Aspect-Oriented Programming (AOP) framework to enhance logging and method invocation handling. Below is a breakdown of the most important changes:

Configuration and Environment Setup:

  • Added a new .env.example file to define environment variables, including database, Keycloak, storage, and logging configurations. This provides a template for configuring the application environment.
  • Updated the Dockerfile to include the STORAGE_LOCATION environment variable and ensure the storage directory is created and owned by the application user.

Dependency Updates:

  • Upgraded the Spring Boot version in infrastructure/build.gradle from 3.4.1 to 3.4.5 and added dependencies for spring-aop and spring-boot-starter-log4j2. Additionally, excluded the default Spring Boot logging module (spring-boot-starter-logging). [1] [2]

AOP Framework Implementation:

  • Introduced an AOP framework to handle method invocation and logging:
    • Added AspectExecutorChain and its concrete implementations (MethodInvocationAspectExecutorChain and PostInvocationAspectExecutorChain) to manage the execution chain of aspects. [1] [2] [3]
    • Created context classes (MethodInvocationContext, PostInvocationContext, and their implementations) to encapsulate method invocation details and results. [1] [2] [3] [4] [5] [6]
    • Added AspectExecutor and its specialized executors (Log4jExecutor, MethodSignatureLogExecutor, PostTelemetryLogExecutor, and ThrowableLogExecutor) to log method signatures, execution time, and exceptions. [1] [2] [3] [4] [5] [6]

These changes collectively enhance the application's configurability, logging capabilities, and modularity, particularly by leveraging AOP for better separation of concerns and centralized logging.

jhonatapers and others added 21 commits May 15, 2025 15:57
…cts for error and execution handling

Co-authored-by: Artur S <Artituis@users.noreply.github.com>
…f method arguments and signatures

Co-authored-by: Artur S <Artituis@users.noreply.github.com>
Co-authored-by: Artur S <Artituis@users.noreply.github.com>
… context records for before and after execution
- Added Spring AOP dependency to build.gradle.
- Removed obsolete AOP classes: AbstractAroundAspectHandler, AspectHandler, AspectAfterExecutionChain, AspectBeforeExecutionChain, AspectExecutionErrorChain.
- Introduced new chains for method invocation and post-invocation aspects: MethodInvocationAspectExecutorChain, PostInvocationAspectExecutorChain.
- Created context classes for method invocation and post-invocation: MethodInvocationContext, PostInvocationContext, and their implementations.
- Implemented logging executors for post-invocation context: Log4jPostExecutor and ThrowableLogExecutor.
- Updated DomainLogConfig to prepare for dynamic aspect configuration.
- Removed deprecated logging aspects: LogAfterExecutionAspect, TelemetryAfterLogAspect, ArgsLogAspect, SignatureLogAspect, TelemetryBeforeLogAspect, LogBeforeExecutionAspect, LogExecutionErrorAspect, StackTraceLogAspect.
- Cleaned up FolderLog class, removing its dependency on AOP chains.
…cutors; remove deprecated dynamic aspect configuration
…application-env.yml for improved configuration management
@jhonatapers jhonatapers self-assigned this May 18, 2025
@jhonatapers jhonatapers added the enhancement New feature or request label May 18, 2025
@jhonatapers jhonatapers linked an issue May 18, 2025 that may be closed by this pull request
@jhonatapers jhonatapers requested a review from Copilot May 18, 2025 19:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces a new Aspect-Oriented Programming (AOP) framework to improve logging and method invocation handling while also updating configuration, dependencies, and Docker setups.

  • Added AOP interceptor and executor chain implementations to handle method invocation, post-invocation, and error logging.
  • Upgraded Spring Boot and logging dependencies and enhanced environment and Docker configuration.

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SimpleMethodInterceptorWithContextHandler.java Adds an AOP interceptor with context handling and chaining of before, after, and error executor chains.
ThrowableLogExecutor.java Implements exception logging using a Java text block for detailed error information.
PostTelemetryLogExecutor.java Logs telemetry data including method execution times.
MethodSignatureLogExecutor.java Logs method invocation signatures.
Log4jExecutor.java Provides base functionality for Log4j-based aspect executors.
IdentifiableAspectExecutor.java, AspectExecutor.java Define executor interfaces, enhancing the AOP chain’s modularity.
SimplePostInvocationContext.java, SimpleMethodInvocationContext.java Encapsulate the context data for method invocations and their corresponding post-invocation processes.
AspectExecutorChain.java and its sub-classes Establish the chain of responsibility for aspect executors.
build.gradle, Dockerfile, .env.example Update dependency versions, add logging dependencies, and enhance configuration setups.

@jhonatapers jhonatapers requested a review from needkg May 18, 2025 20:37
@jhonatapers jhonatapers merged commit aa1d5a9 into develop May 18, 2025
@github-project-automation github-project-automation Bot moved this to Done in CallV2 May 18, 2025
@jhonatapers jhonatapers deleted the feature/aop branch May 18, 2025 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants