zone1511 commented on a change in pull request #770: Decouple JDBCURL parser
logic from URLParser question
URL:
https://github.com/apache/incubator-skywalking/pull/770#discussion_r170457587
##########
File path:
apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/URLParser.java
##########
@@ -29,22 +33,36 @@
*/
public class URLParser {
- private static final String MYSQL_JDBC_URL_PREFIX = "jdbc:mysql";
- private static final String ORACLE_JDBC_URL_PREFIX = "jdbc:oracle";
- private static final String H2_JDBC_URL_PREFIX = "jdbc:h2";
- private static final String POSTGRESQL_JDBC_URL_PREFIX = "jdbc:postgresql";
+ private static ServiceLoader<ConnectionURLParser> JDBCPARSERS
+ = ServiceLoader.load(ConnectionURLParser.class, URLParser.class
+ .getClassLoader());
Review comment:
I use a standalone java app with the agent to test and if I use
`AgentClassLoader#getDefault` it will result loading a URLparser implementation
which is not compatible with URLParser
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services