A Java-based execution framework designed to manage task resilience in unstable environments. It implements advanced Design Patterns to handle execution failures using modular strategies, protecting system resources from cascading failures through intelligent state management.
- Strategy Pattern: Decouples retry and circuit breaker logic from the execution engine
- State Pattern: Implements a three-state Circuit Breaker (Closed, Open, Half-Open) to manage system health
- Observer Pattern: Provides a decoupled monitoring layer to log failures without affecting business logic
- Command Pattern: Encapsulates operations into generic Task objects
- Generics: Full support for typed task returns using Java Generics
- Custom Exception Hierarchy: Specific resilience error handling via
ResilienceException - Resource Protection: Immediate request blocking when the system detects persistent external failures
resilience-engine/
├── src/
│ ├── core/
│ │ ├── Task interfaces
│ │ ├── Generic Executor
│ │ └── Custom exceptions
│ ├── strategies/
│ │ ├── FixedRetry
│ │ ├── ExponentialBackoff
│ │ └── CircuitBreaker
│ ├── monitoring/
│ │ ├── Observer interfaces
│ │ └── Logging implementations
│ └── tasks/
│ └── Concrete implementations (e.g., NetworkTask)
└── README.md
- JDK 17 or higher
javac -d bin src/**/*.java src/*.javajava -cp bin MainCourse: Advanced Object-Oriented Programming (Programação Orientada a Objetos Avançada)
Department: Department of Computing (DC)
Institution: Federal University of São Carlos (UFSCar)
Allows the selection of retry algorithms at runtime, enabling flexible failure handling strategies without modifying the core execution logic.
The Circuit Breaker transitions between three states:
- Closed: Normal operation, requests pass through
- Open: Failure threshold exceeded, requests are blocked
- Half-Open: Testing phase to check if the system has recovered
Monitoring components observe execution events without tight coupling to the execution engine, facilitating extensible logging and metrics collection.
Tasks are encapsulated as first-class objects, enabling queuing, scheduling, and execution of operations in a uniform manner.
This project is developed for academic purposes at UFSCar.
Developed with ☕ and resilience patterns