-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ClientConnectionListener listener #12421
Conversation
Signed-off-by: Oleksandr Krutko <[email protected]>
@arsenalzp Would it be OK if we implemented this in jetty-12.1.0 rather than 12.0.x? We are trying to feature freeze 12.0 |
This approach is OK for me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arsenalzp good start.
Please review my comments, but I really need you to add test cases.
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
Of course it is good to have test cases, however as I said it is the draft, just to show the framework of solution. |
Signed-off-by: Oleksandr Krutko <[email protected]>
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
I'm thinking about the place of What do you think? |
@arsenalzp put the test class in the |
@arsenalzp please also fix the formatting, see here why the build fails: |
Yeah, issue has been fixed already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arsenalzp another thing.
Instead of calling getBeans(ClientConnector.ConnectListener.class)
every time, which is an expensive operation, please override add/removeEventListener
, and store the ConnectListener
in a local CopyOnWriteArrayList
field, so the notification is faster.
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
Hello,
|
@arsenalzp in the base class you have a field for I am proposing that you do similarly in |
Signed-off-by: Oleksandr Krutko <[email protected]>
Signed-off-by: Oleksandr Krutko <[email protected]>
It is clear for me now, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arsenalzp another good step, please review my comments.
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Oleksandr Krutko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arsenalzp looks good, two things:
- wrap the calls to
ConnectListener
methods intotry/catch(Throwable)
. - Write tests.
Thanks!
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Show resolved
Hide resolved
Signed-off-by: Oleksandr Krutko <[email protected]>
Signed-off-by: Oleksandr Krutko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arsenalzp FYI there is a Jetty release coming at the end of the month.
If you manage to finish in time, this contribution will be in the next release, otherwise it will go in the next-next release.
Thanks!
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnector.java
Show resolved
Hide resolved
Let's try to include this enhancement into the upcoming release! |
Signed-off-by: Oleksandr Krutko <[email protected]>
Signed-off-by: Oleksandr Krutko <[email protected]>
I took other tests of |
@arsenalzp thanks for this contribution! I have integrated your work in #12570, so I am closing this PR. |
Does it mean my work within this PR was either unacceptable or done badly? |
No, your work was ok, but needed a little more polishing and more testing, but overall it was accepted for this upcoming release. Have a look at the new PR for the differences. Mainly:
Thanks again for this contribution! Let me know if you want to tackle something else by looking at the |
Yes, I'm working on that issue as well, it is just a new topic for me - JMX and so on. |
Here is the draft of changes proposed to solve #9529
Let's discuss it in the issue thread as the implementation was not hardened yet.