Package com.dianping.cat.core.config

Examples of com.dianping.cat.core.config.Config


  }

  @Override
  public void initialize() throws InitializationException {
    try {
      Config config = m_configDao.findByName(CONFIG_NAME, ConfigEntity.READSET_FULL);
      String content = config.getContent();

      m_configId = config.getId();
      m_bugConfig = DefaultSaxParser.parse(content);
    } catch (DalNotFoundException e) {
      try {
        String content = Files.forIO().readFrom(
              this.getClass().getResourceAsStream("/config/default-bug-config.xml"), "utf-8");
        Config config = m_configDao.createLocal();

        config.setName(CONFIG_NAME);
        config.setContent(content);
        m_configDao.insert(config);

        m_configId = config.getId();
        m_bugConfig = DefaultSaxParser.parse(content);
      } catch (Exception ex) {
        Cat.logError(ex);
      }
    } catch (Exception e) {
View Full Code Here


  }

  private boolean storeConfig() {
    synchronized (this) {
      try {
        Config config = m_configDao.createLocal();

        config.setId(m_configId);
        config.setKeyId(m_configId);
        config.setName(CONFIG_NAME);
        config.setContent(m_bugConfig.toString());
        m_configDao.updateByPK(config, ConfigEntity.UPDATESET_FULL);
      } catch (Exception e) {
        Cat.logError(e);
        return false;
      }
View Full Code Here

  }

  @Override
  public void initialize() throws InitializationException {
    try {
      Config config = m_configDao.findByName(CONFIG_NAME, ConfigEntity.READSET_FULL);
      String content = config.getContent();

      m_configId = config.getId();
      m_config = DefaultSaxParser.parse(content);
    } catch (DalNotFoundException e) {
      try {
        String content = Files.forIO().readFrom(
              this.getClass().getResourceAsStream("/config/default-system-rule-config.xml"), "utf-8");
        Config config = m_configDao.createLocal();

        config.setName(CONFIG_NAME);
        config.setContent(content);
        m_configDao.insert(config);

        m_configId = config.getId();
        m_config = DefaultSaxParser.parse(content);
      } catch (Exception ex) {
        Cat.logError(ex);
      }
    } catch (Exception e) {
View Full Code Here

  }

  private boolean storeConfig() {
    synchronized (this) {
      try {
        Config config = m_configDao.createLocal();

        config.setId(m_configId);
        config.setKeyId(m_configId);
        config.setName(CONFIG_NAME);
        config.setContent(m_config.toString());
        m_configDao.updateByPK(config, ConfigEntity.UPDATESET_FULL);
      } catch (Exception e) {
        Cat.logError(e);
        return false;
      }
View Full Code Here

  }

  @Override
  public void initialize() {
    try {
      Config config = m_configDao.findByName(CONFIG_NAME, ConfigEntity.READSET_FULL);
      String content = config.getContent();

      m_configId = config.getId();
      m_config = DefaultSaxParser.parse(content);
      m_modifyTime = config.getModifyDate().getTime();
      refreshData();
    } catch (DalNotFoundException e) {
      try {
        String content = Files.forIO().readFrom(
              this.getClass().getResourceAsStream("/config/default-app-config.xml"), "utf-8");
        Config config = m_configDao.createLocal();

        config.setName(CONFIG_NAME);
        config.setContent(content);
        m_configDao.insert(config);
        m_configId = config.getId();
        m_config = DefaultSaxParser.parse(content);
      } catch (Exception ex) {
        Cat.logError(ex);
      }
    } catch (Exception e) {
View Full Code Here

      return new ArrayList<Item>();
    }
  }

  public void refreshAppConfigConfig() throws DalException, SAXException, IOException {
    Config config = m_configDao.findByName(CONFIG_NAME, ConfigEntity.READSET_FULL);
    long modifyTime = config.getModifyDate().getTime();

    synchronized (this) {
      if (modifyTime > m_modifyTime) {
        String content = config.getContent();
        AppConfig appConfig = DefaultSaxParser.parse(content);

        m_config = appConfig;
        m_modifyTime = modifyTime;
        refreshData();
View Full Code Here

    m_operators = operatorMap;
  }

  private boolean storeConfig() {
    try {
      Config config = m_configDao.createLocal();

      config.setId(m_configId);
      config.setKeyId(m_configId);
      config.setName(CONFIG_NAME);
      config.setContent(m_config.toString());
      m_configDao.updateByPK(config, ConfigEntity.UPDATESET_FULL);

      refreshData();
    } catch (Exception e) {
      Cat.logError(e);
View Full Code Here

  }

  @Override
  public void initialize() throws InitializationException {
    try {
      Config config = m_configDao.findByName(CONFIG_NAME, ConfigEntity.READSET_FULL);
      String content = config.getContent();

      m_configId = config.getId();
      m_domainGroup = DefaultSaxParser.parse(content);
    } catch (DalNotFoundException e) {
      try {
        String content = Files.forIO().readFrom(
              this.getClass().getResourceAsStream("/config/default-domain-group-config.xml"), "utf-8");
        Config config = m_configDao.createLocal();

        config.setName(CONFIG_NAME);
        config.setContent(content);
        m_configDao.insert(config);

        m_configId = config.getId();
        m_domainGroup = DefaultSaxParser.parse(content);
      } catch (Exception ex) {
        Cat.logError(ex);
      }
    } catch (Exception e) {
View Full Code Here

  }

  private boolean storeConfig() {
    synchronized (this) {
      try {
        Config config = m_configDao.createLocal();

        config.setId(m_configId);
        config.setKeyId(m_configId);
        config.setName(CONFIG_NAME);
        config.setContent(m_domainGroup.toString());
        m_configDao.updateByPK(config, ConfigEntity.UPDATESET_FULL);
      } catch (Exception e) {
        Cat.logError(e);
        return false;
      }
View Full Code Here

  }

  @Override
  public void initialize() throws InitializationException {
    try {
      Config config = m_configDao.findByName(CONFIG_NAME, ConfigEntity.READSET_FULL);
      String content = config.getContent();

      m_configId = config.getId();
      m_config = DefaultSaxParser.parse(content);
    } catch (DalNotFoundException e) {
      try {
        String content = Files.forIO().readFrom(
              this.getClass().getResourceAsStream("/config/default-app-rule-config.xml"), "utf-8");
        Config config = m_configDao.createLocal();

        config.setName(CONFIG_NAME);
        config.setContent(content);
        m_configDao.insert(config);

        m_configId = config.getId();
        m_config = DefaultSaxParser.parse(content);
      } catch (Exception ex) {
        Cat.logError(ex);
      }
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.dianping.cat.core.config.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.