當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultConfigFactory類代碼示例

本文整理匯總了Java中com.jkoolcloud.tnt4j.config.DefaultConfigFactory的典型用法代碼示例。如果您正苦於以下問題:Java DefaultConfigFactory類的具體用法?Java DefaultConfigFactory怎麽用?Java DefaultConfigFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DefaultConfigFactory類屬於com.jkoolcloud.tnt4j.config包,在下文中一共展示了DefaultConfigFactory類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadLoggerConfig

import com.jkoolcloud.tnt4j.config.DefaultConfigFactory; //導入依賴的package包/類
/**
 * Loads and sets up instance of {@link TrackerConfig} to be used to create scheduler logger.
 *
 * @param name name of assigned to the sampler
 * @param sFactory sampler factory instance
 * @param listener activity listener invoked when scheduled activity starts and stops
 * @return tracker configuration used to create scheduler logger
 */
protected static TrackerConfig loadLoggerConfig(String name, SamplerFactory sFactory, ActivityListener listener) {
	TrackerConfig config = DefaultConfigFactory.getInstance().getConfig(name);

	if (sFactory != null && StringUtils.isEmpty(config.getProperty("event.formatter"))) {
		config.setProperty("event.formatter", sFactory.defaultEventFormatterClassName());
		((TrackerConfigStore) config).applyProperties();
	}

	if (listener != null) {
		config.setActivityListener(listener);
	}

	return config;
}
 
開發者ID:Nastel,項目名稱:tnt4j-stream-jmx,代碼行數:23,代碼來源:SchedulerImpl.java

示例2: ActivityScheduler

import com.jkoolcloud.tnt4j.config.DefaultConfigFactory; //導入依賴的package包/類
/**
 * Creates a scheduler with specified name.
 *
 * @param name
 *            scheduler name
 * @param listener
 *            activity listener invoked when scheduled activity starts and stops
 *
 * @see ActivityListener
 */
public ActivityScheduler(String name, ActivityListener listener) {
	this.name = name;
	TrackerConfig config = DefaultConfigFactory.getInstance().getConfig(name);
	if (listener != null)
		config.setActivityListener(listener);
	this.logger = TrackingLogger.getInstance(config.build());
	this.logger.setKeepThreadContext(false);
}
 
開發者ID:Nastel,項目名稱:TNT4J,代碼行數:19,代碼來源:ActivityScheduler.java

示例3: getInstance

import com.jkoolcloud.tnt4j.config.DefaultConfigFactory; //導入依賴的package包/類
/**
 * Obtain an instance of {@code TrackingLogger} logger.
 *
 * @param sourceName
 *            application source name associated with this logger
 * @return tracking logger instance
 * @see TrackerConfig
 */
public static TrackingLogger getInstance(String sourceName) {
	TrackerConfig config = DefaultConfigFactory.getInstance().getConfig(sourceName);
	TrackingLogger tracker = new TrackingLogger(factory.getInstance(config.build()));
	registerTracker(tracker);
	return tracker;
}
 
開發者ID:Nastel,項目名稱:TNT4J,代碼行數:15,代碼來源:TrackingLogger.java


注:本文中的com.jkoolcloud.tnt4j.config.DefaultConfigFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。