Ejemplo n.º 1
0
  private boolean isValidId(String propertyName, int maxSize) {
    logger.info("check -D" + propertyName);
    String value = systemProperty.getProperty(propertyName);
    if (value == null) {
      logger.severe("-D" + propertyName + " is null. value:null");
      return false;
    }
    // blanks not permitted around value
    value = value.trim();
    if (value.isEmpty()) {
      logger.severe("-D" + propertyName + " is empty. value:''");
      return false;
    }

    if (!IdValidateUtils.validateId(value, maxSize)) {
      logger.severe(
          "invalid Id. "
              + propertyName
              + " can only contain [a-zA-Z0-9], '.', '-', '_'. maxLength:"
              + maxSize
              + " value:"
              + value);
      return false;
    }
    if (logger.isLoggable(Level.INFO)) {
      logger.info("check success. -D" + propertyName + ":" + value + " length:" + getLength(value));
    }
    return true;
  }
Ejemplo n.º 2
0
  private String getConfigPath(ClassPathResolver classPathResolver) {
    final String configName = ProductInfo.NAME + ".config";
    String pinpointConfigFormSystemProperty = systemProperty.getProperty(configName);
    if (pinpointConfigFormSystemProperty != null) {
      logger.info(configName + " systemProperty found. " + pinpointConfigFormSystemProperty);
      return pinpointConfigFormSystemProperty;
    }

    String classPathAgentConfigPath = classPathResolver.getAgentConfigPath();
    if (classPathAgentConfigPath != null) {
      logger.info("classpath " + configName + " found. " + classPathAgentConfigPath);
      return classPathAgentConfigPath;
    }

    logger.severe(configName + " file not found.");
    return null;
  }
Ejemplo n.º 3
0
 private void savePinpointVersion() {
   logger.info("pinpoint version:" + Version.VERSION);
   systemProperty.setProperty(ProductInfo.NAME + ".version", Version.VERSION);
 }
Ejemplo n.º 4
0
  private void saveLogFilePath(ClassPathResolver classPathResolver) {
    String agentLogFilePath = classPathResolver.getAgentLogFilePath();
    logger.info("logPath:" + agentLogFilePath);

    systemProperty.setProperty(ProductInfo.NAME + ".log", agentLogFilePath);
  }