Search in sources :

Example 1 with JdbcUrlParserV2

use of com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2 in project pinpoint by naver.

the class DefaultJdbcUrlParsingService method parseJdbcUrl.

@Override
public DatabaseInfo parseJdbcUrl(ServiceType serviceType, String jdbcUrl) {
    if (jdbcUrl == null) {
        return UnKnownDatabaseInfo.INSTANCE;
    }
    CacheKey cacheKey = new CacheKey(serviceType, jdbcUrl);
    DatabaseInfo cacheValue = eachServiceTypeCache.get(cacheKey);
    if (cacheValue != null) {
        return cacheValue;
    }
    for (JdbcUrlParserV2 parser : jdbcUrlParserList) {
        if (serviceType == parser.getServiceType()) {
            DatabaseInfo databaseInfo = parser.parse(jdbcUrl);
            return putCacheIfAbsent(cacheKey, databaseInfo);
        }
    }
    return putCacheIfAbsent(cacheKey, UnKnownDatabaseInfo.createUnknownDataBase(jdbcUrl));
}
Also used : UnKnownDatabaseInfo(com.navercorp.pinpoint.bootstrap.plugin.jdbc.UnKnownDatabaseInfo) DatabaseInfo(com.navercorp.pinpoint.bootstrap.context.DatabaseInfo) JdbcUrlParserV2(com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2)

Example 2 with JdbcUrlParserV2

use of com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2 in project pinpoint by naver.

the class JdbcUrlParsingServiceProvider method get.

@Override
public JdbcUrlParsingService get() {
    PluginContextLoadResult pluginContextLoadResult = this.pluginContextLoadResultProvider.get();
    List<JdbcUrlParserV2> jdbcUrlParserList = pluginContextLoadResult.getJdbcUrlParserList();
    return new DefaultJdbcUrlParsingService(jdbcUrlParserList);
}
Also used : DefaultJdbcUrlParsingService(com.navercorp.pinpoint.profiler.context.monitor.DefaultJdbcUrlParsingService) JdbcUrlParserV2(com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2) PluginContextLoadResult(com.navercorp.pinpoint.profiler.plugin.PluginContextLoadResult)

Aggregations

JdbcUrlParserV2 (com.navercorp.pinpoint.bootstrap.plugin.jdbc.JdbcUrlParserV2)2 DatabaseInfo (com.navercorp.pinpoint.bootstrap.context.DatabaseInfo)1 UnKnownDatabaseInfo (com.navercorp.pinpoint.bootstrap.plugin.jdbc.UnKnownDatabaseInfo)1 DefaultJdbcUrlParsingService (com.navercorp.pinpoint.profiler.context.monitor.DefaultJdbcUrlParsingService)1 PluginContextLoadResult (com.navercorp.pinpoint.profiler.plugin.PluginContextLoadResult)1