private void readConfig ( ) { AccumulatorsConfig config = MoskitoConfigurationHolder . getConfiguration ( ) . getAccumulatorsConfig ( ) ; AccumulatorConfig [ ] acs = config . getAccumulators ( ) ; if ( acs != null && acs . length > 0 ) { for ( AccumulatorConfig ac : acs ) { AccumulatorDefinition ad = new AccumulatorDefinition ( ) ; ad . setName ( ac . getName ( ) ) ; ad . setIntervalName ( ac . getIntervalName ( ) ) ; ad . setProducerName ( ac . getProducerName ( ) ) ; ad . setStatName ( ac . getStatName ( ) ) ; ad . setTimeUnit ( TimeUnit . valueOf ( ac . getTimeUnit ( ) ) ) ; ad . setValueName ( ac . getValueName ( ) ) ; Accumulator acc = createAccumulator ( ad ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Created accumulator " + acc ) ; } } } AutoAccumulatorConfig [ ] autoAccumulatorConfigs = config . getAutoAccumulators ( ) ; if ( autoAccumulatorConfigs != null && autoAccumulatorConfigs . length > 0 ) { for ( AutoAccumulatorConfig aac : autoAccumulatorConfigs ) { AutoAccumulatorDefinition aad = new AutoAccumulatorDefinition ( ) ; aad . setNamePattern ( aac . getNamePattern ( ) ) ; aad . setProducerNamePattern ( aac . getProducerNamePattern ( ) ) ; aad . setIntervalName ( aac . getIntervalName ( ) ) ; aad . setValueName ( aac . getValueName ( ) ) ; aad . setStatName ( aac . getStatName ( ) ) ; aad . setTimeUnit ( TimeUnit . fromString ( aac . getTimeUnit ( ) ) ) ; aad . setAccumulationAmount ( aac . getAccumulationAmount ( ) ) ; autoAccumulatorDefinitions . add ( aad ) ; } } }
Reads the config and creates configured accumulators . For now this method is only executed on startup .