-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
feat: Add generic proxy implementation #11201
Conversation
|
SonarCloud Quality Gate failed. |
I'm concerned about adding things to the Support package, especially things that are specific to one language. Would it be an option for this to get bundled into a separate jar in a separate repo? |
No problem. I'll more the pr to Appium java client |
Well, mine is just one opinion, I was curious if it might make sense to do it independently. :) @diemol what do you think about this in Selenium vs Appium (vs separate package)? |
@mykola-mokhnach Thank you for your contribution. Can you help me understand how will this proxy be used to solve appium/java-client#1694 (comment)? How can it be used by Selenium? Just trying to understand where the code should sit. Do you have any follow-up PRs in mind that touches on the current decorators implementation? @titusfortner We have webdriver decorator in the support package for Java. That functionality is specific to Java. So on that point, I don't see an issue. However, I want to first understand how this proxy will be used since it seems to address a broader Java concern and for that separating out is a good idea. |
@pujagani Please check appium/java-client#1790 |
Thank you for sharing that PR. It has helped answer my questions. |
Description
This is my proposal to solve appium/java-client#1694 (comment)
Motivation and Context
There is no easy way in Java to patch/instrument a class if it is already loaded. Java Agent mechanism allows that, but it requires users to change the way their jar is being executed and is pretty complicated.
This implementation allows to create a generic proxy for any class and add one or more listeners to public method invocations. The current decorators implementation stays untouched though. I was not able to find an acceptable way to modify it in a non-breaking manner to support the current proxying strategy.
Types of changes
cc @valfirst @pujagani