Package com.taobao.tddl.common.config.impl

Examples of com.taobao.tddl.common.config.impl.DefaultConfigDataHandlerFactory


  private ConfigDataHandlerFactory configFactory;
  private ConfigDataHandler passwdHandler;
  private volatile List<ConfigDataListener> passwdConfListener = new ArrayList<ConfigDataListener>();

  public void init() {
    configFactory = new DefaultConfigDataHandlerFactory();
    Map<String, String> config = new HashMap<String, String>();
    config.put("group", TAtomConstants.DEFAULT_DIAMOND_GROUP);
    passwdHandler = configFactory.getConfigDataHandlerWithListenerListCE(
        passwdConfDataId, passwdConfListener,
        Executors.newSingleThreadScheduledExecutor(), config);
View Full Code Here


  private ConfigDataHandler appDBHandler;
  private volatile List<ConfigDataListener> globalDbConfListener = new ArrayList<ConfigDataListener>();
  private volatile List<ConfigDataListener> appDbConfListener = new ArrayList<ConfigDataListener>();

  public void init() {
    configFactory = new DefaultConfigDataHandlerFactory();
    Map<String, String> config = new HashMap<String, String>();
    config.put("group", TAtomConstants.DEFAULT_DIAMOND_GROUP);
    globalHandler = configFactory.getConfigDataHandlerWithListenerListCE(
        globalConfigDataId, globalDbConfListener,
        Executors.newSingleThreadScheduledExecutor(), config);
View Full Code Here

    // ����: ��Ҫ�ڹ���DefaultDiamondManagerʱ��ע��ManagerListener(����:configReceiver)
    // Ҳ����˵����Ҫ������: new DefaultDiamondManager(dbGroupKey, configReceiver)��
    // ����Ҫ���null���ȵ�һ��ȡ����Ϣ��������ɺ���ע�ᣬ�������Բ���ͬ���������κ��벢����ص����⣬
    // ��Ϊ�п����ڵ�һ�θ�ȡ����Ϣ��Diamond���������DZ������޸��˼�¼������ManagerListener����߳������յ���Ϣ��
    // ��ɳ�ʼ���̺߳�ManagerListener�߳�ͬʱ������Ϣ��
    configFactory = new DefaultConfigDataHandlerFactory();
    globalHandler = configFactory.getConfigDataHandler(
        tGroupDataSource.getFullDbGroupKey(), null);

    String dsWeightCommaStr = globalHandler.getData(
        tGroupDataSource.getConfigReceiveTimeout(),
        ConfigDataHandler.FIRST_CACHE_THEN_SERVER_STRATEGY);

    //extra config
    extraFactory=new DefaultConfigDataHandlerFactory();
    extraHandler=extraFactory.getConfigDataHandler(
        tGroupDataSource.getDbGroupExtraConfigKey(), null);
    String extraConfig=extraHandler.getData(tGroupDataSource.getConfigReceiveTimeout(),
        ConfigDataHandler.FIRST_CACHE_THEN_SERVER_STRATEGY);
View Full Code Here

  private volatile static ConfigDataHandlerFactory cdhf;
  private static final long DIAMOND_FIRST_DATA_TIMEOUT=15*1000;
 
  public static Object subscribePersistentData(String subscriberName, String dataId, final DataListener listener) {
    cdhf = new DefaultConfigDataHandlerFactory();
    ConfigDataHandler matrixHandler = cdhf.getConfigDataHandler(dataId, null);
    String datas = matrixHandler.getData(DIAMOND_FIRST_DATA_TIMEOUT, ConfigDataHandler.FIRST_CACHE_THEN_SERVER_STRATEGY); //ȡ������Ϣ��Ĭ�ϳ�ʱʱ��Ϊ30��

    //����ȥ�����µı�������
    log.warn(dataId + "'s firstData=" + datas);
View Full Code Here

TOP

Related Classes of com.taobao.tddl.common.config.impl.DefaultConfigDataHandlerFactory

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.