[
https://issues.apache.org/jira/browse/LANG-1085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14557668#comment-14557668
]
Bruno P. Kinoshita commented on LANG-1085:
------------------------------------------
Hello again Oliver!
Had a look again at the patch today, and I really think making the
CircuitBreaker more generic would be a good idea. My goal is to use your
CircuitBreaker to create a MemoryCircuitBreaker, as in ElasticSearch. The
MemoryCircuitBreaker doesn't need to be reset after a period of time, so it
wouldn't fit into the current design of the CircuitBreaker contract.
What do you think of the follow plan:
- Create the following class hierarchy
{noformat}
+--------------+
|CircuitBreaker|
+------+-------+
^
|
|
|
|
+----------+------------+
| AbstractCircuitBreaker|
+----------+------------+
^
|
|
+---------------+----------------+
| |
| |
+---------+---------+ ----------+---------+
|TimerCircuitBreaker| |MemoryCircuitBreaker|
+-------------------+ +--------------------+
{noformat}
- Move the `AtomicReference`'s and the `PropertyChangeSupport` to the abstract
circuit breaker
- Move the `Timer`'s to the timer circuit breaker
- Extract a generic contract for the `CircuitBreaker` interface
> I guess such an interface would have methods like open(), close(), isOpen(),
> isClosed(), checkState(), incrementAndCheckState()
+1 Sounds like good methods for our initial tests :-)
Do you think that makes sense?
> Add a circuit breaker implementation
> ------------------------------------
>
> Key: LANG-1085
> URL: https://issues.apache.org/jira/browse/LANG-1085
> Project: Commons Lang
> Issue Type: New Feature
> Components: lang.concurrent.*
> Reporter: Oliver Heger
> Attachments: CircuitBreaker.java, CircuitBreakerTest.java
>
>
> A _circuit breaker_ is a useful component to protect an application against
> unreliable services or load peaks. A simple implementation could be a good
> fit for the concurrent package.
> A proposed implementation is attached. Feedback is welcome!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)