Search in sources :

Example 1 with ApplicationTypeDetector

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

the class ApplicationServerTypeProvider method get.

@Override
public ServiceType get() {
    final ServiceType applicationServiceType = getApplicationServiceType();
    logger.info("default ApplicationServerType={}", applicationServiceType);
    PluginContextLoadResult pluginContextLoadResult = this.pluginContextLoadResultProvider.get();
    List<ApplicationTypeDetector> applicationTypeDetectorList = pluginContextLoadResult.getApplicationTypeDetectorList();
    ApplicationServerTypeResolver applicationServerTypeResolver = new ApplicationServerTypeResolver(applicationTypeDetectorList, applicationServiceType, profilerConfig.getApplicationTypeDetectOrder());
    ServiceType resolve = applicationServerTypeResolver.resolve();
    logger.info("resolved ApplicationServerType={}", resolve);
    return resolve;
}
Also used : ApplicationServerTypeResolver(com.navercorp.pinpoint.profiler.util.ApplicationServerTypeResolver) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) ApplicationTypeDetector(com.navercorp.pinpoint.bootstrap.plugin.ApplicationTypeDetector) PluginContextLoadResult(com.navercorp.pinpoint.profiler.plugin.PluginContextLoadResult)

Example 2 with ApplicationTypeDetector

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

the class ApplicationServerTypePluginResolver method resolve.

public ServiceType resolve() {
    for (ApplicationTypeDetector currentDetector : this.applicationTypeDetectors) {
        String currentDetectorName = currentDetector.getClass().getName();
        logger.info("Attempting to resolve using [{}]", currentDetectorName);
        if (currentDetector.detect(this.conditionProvider)) {
            logger.info("Match found using [{}]", currentDetectorName);
            return currentDetector.getApplicationType();
        } else {
            logger.info("No match found using [{}]", currentDetectorName);
        }
    }
    logger.debug("Server type not resolved. Defaulting to {}", DEFAULT_SERVER_TYPE.getName());
    return DEFAULT_SERVER_TYPE;
}
Also used : ApplicationTypeDetector(com.navercorp.pinpoint.bootstrap.plugin.ApplicationTypeDetector)

Aggregations

ApplicationTypeDetector (com.navercorp.pinpoint.bootstrap.plugin.ApplicationTypeDetector)2 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)1 PluginContextLoadResult (com.navercorp.pinpoint.profiler.plugin.PluginContextLoadResult)1 ApplicationServerTypeResolver (com.navercorp.pinpoint.profiler.util.ApplicationServerTypeResolver)1