本文整理匯總了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;
}
示例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);
}
示例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;
}