public void createAccumulator(final OnDemandStatsProducer producer, final A annotation, final Method method) {
		if (producer != null && annotation != null) {

			final String statsName = (method == null) ? OnDemandStatsProducer.CUMULATED_STATS_NAME : method.getName();

			String accumulatorName = getName(annotation);
			if (StringUtils.isEmpty(accumulatorName))
				accumulatorName = method == null ? formAccumulatorNameForClass(producer, annotation) :
						formAccumulatorNameForMethod(producer, annotation, method);

			createAccumulator(
					producer.getProducerId(),
					annotation,
					accumulatorName,
					statsName
			);
		}
	}
public void createAccumulator ( final OnDemandStatsProducer producer , final A annotation , final Method method ) { if ( producer != null && annotation != null ) { final String statsName = ( method == null ) ? OnDemandStatsProducer . CUMULATED_STATS_NAME : method . getName ( ) ; String accumulatorName = getName ( annotation ) ; if ( StringUtils . isEmpty ( accumulatorName ) ) accumulatorName = method == null ? formAccumulatorNameForClass ( producer , annotation ) : formAccumulatorNameForMethod ( producer , annotation , method ) ; createAccumulator ( producer . getProducerId ( ) , annotation , accumulatorName , statsName ) ; } }
Create and register new {@link Accumulator} for class/method level stats accumulation.
In case producer or annotation is null does nothing.

@param producer
stats producer
@param annotation
{@link Accumulate} or {@link AccumulateWithSubClasses} annotation used to create {@link Accumulator}.
@param method
{@link Method} that was annotated or null in case ot class-level accumulator.